Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2008
    Posts
    82

    export .reg files to use them on rollback options

    Hello Friends,

    My installation sets or changes registry entries at various places on host. I can try doing a GetValue or GetValueNames to retrieve the registry values. But if I want to backup a whole .reg file, say HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.

    Need help on taking backup of parts of registry tree to use them on an Uninstall.
    Please help...

  2. #2
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,539
    Quote Originally Posted by kk250040 View Post
    But if I want to backup a whole .reg file, say HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.
    See this example to export the hive to your temporary folder:

    Code:
    Shell.Execute("reg", "open", "EXPORT HKEY_LOCAL_MACHINE\\Software\\Microsoft " .. _TempFolder .. "\\registry_export.reg", "", SW_MINIMIZE);
    Modify as necessary and check the command line options of REG (the Console Registry Tool for Windows) for further inspiration. Hope this helps.

    Ulrich

  3. #3
    Join Date
    Feb 2008
    Posts
    82

    Thanq upeters

    I will try this thanq, Seems this would work.

  4. #4
    Join Date
    Feb 2008
    Posts
    82

    This didnot work

    Hello Friends,

    I was stuck with many other tasks that I couldnot comeback on this till now. Now its important for me to complete, so please help.

    I have tried the following action on a StartUp of an installation, but the desktop folder did not contain the .reg file. Please let me know what i can do to correct this.

    Shell.Execute("regedit", "open", "EXPORT HKEY_LOCAL_MACHINE\\Software\\Microsoft " .. _DesktopFolder .. "\\registry_export.reg", "", SW_MINIMIZE);
    Thanks in advance!

  5. #5
    Join Date
    Feb 2008
    Posts
    82

    Thumbs up Solution for Backup using Batch Files

    The best that i could do simply is to write a batch file for backing up my registry and folders/files. Posting the sample batch file script for people who might want to do a similar job...


    @echo off
    :: variables
    set drive=G:\Backup
    set backupcmd=xcopy /s /c /d /e /h /i /r /y

    echo ### Backing up My Documents...
    %backupcmd% "%USERPROFILE%\My Documents" "%drive%\My Documents"

    echo ### Backing up Favorites...
    %backupcmd% "%USERPROFILE%\Favorites" "%drive%\Favorites"

    echo ### Backing up email and address book (Outlook Express)...
    %backupcmd% "%USERPROFILE%\Application Data\Microsoft\Address Book" "%drive%\Address Book"
    %backupcmd% "%USERPROFILE%\Local Settings\Application Data\Identities" "%drive%\Outlook Express"

    echo ### Backing up email and contacts (MS Outlook)...
    %backupcmd% "%USERPROFILE%\Local Settings\Application Data\Microsoft\Outlook" "%drive%\Outlook"

    echo ### Backing up of a branch or part of Registry...
    if not exist "%drive%\Registry" mkdir "%drive%\Registry"
    if exist "%drive%\Registry\OracleRegbackup.reg" del "%drive%\Registry\OracleRegbackup.reg"
    regedit /e "%drive%\Registry\OracleRegbackup.reg" "HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE"

    echo ### Backing up of whole Registry...
    if not exist "%drive%\Registry" mkdir "%drive%\Registry"
    if exist "%drive%\Registry\regbackup.reg" del "%drive%\Registry\regbackup.reg"
    regedit /e "%drive%\Registry\regbackup.reg"

    :: use below syntax to backup other directories...
    :: %backupcmd% "...source directory..." "%drive%\...destination dir..."

    echo Backup Complete!
    @pause
    The text file with this content can be saved with a .bat extension and its ready to take backup. This file can just be included in the setup and run for having a backup. I got the simliar work around in some web pages and thought to add such in the forum.
    Last edited by kk250040; 12-05-2008 at 05:45 AM. Reason: correcting my incorrect coding and few lines edited

  6. #6
    Join Date
    Apr 2010
    Posts
    2
    The correct command line syntax for exporting a key is :
    REGEDIT /e File_name.reg regkey_name

    This means the code from above should be:

    Code:
    Shell.Execute("reg", "open", "/e " .. _TempFolder .. "\\registry_export.reg HKEY_LOCAL_MACHINE\\Software\\Microsoft", "", SW_MINIMIZE);
    Technically the file name could have any (or no) extension.

Similar Threads

  1. .REG files
    By doohoodogg in forum AutoPlay Media Studio 6.0
    Replies: 2
    Last Post: 07-06-2006, 06:17 PM
  2. .reg files
    By doohoodogg in forum AutoPlay Media Studio 6.0
    Replies: 1
    Last Post: 07-02-2006, 02:33 PM
  3. Unable to find software?
    By NigelLacey in forum Visual Patch 2.0
    Replies: 4
    Last Post: 10-11-2005, 10:35 AM
  4. method to index/compare user's files for update?
    By intel352 in forum Setup Factory 6.0
    Replies: 0
    Last Post: 01-15-2003, 03:08 PM
  5. INFO: Why Files are Renamed in the DATA Folder
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-24-2002, 03:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts