1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Save registry entry w/ Batch file

Discussion in 'Windows XP' started by BruceKrymow, 2005/01/31.

Thread Status:
Not open for further replies.
  1. 2005/01/31
    BruceKrymow

    BruceKrymow Inactive Thread Starter

    Joined:
    2002/03/20
    Messages:
    548
    Likes Received:
    0
    I have a batch file for regular automatic backups. How do I add a line to my batch file to save a registry entry in addition to the files I am saving?
     
  2. 2005/01/31
    BruceKrymow

    BruceKrymow Inactive Thread Starter

    Joined:
    2002/03/20
    Messages:
    548
    Likes Received:
    0
    Okay...I got it figured out.

    For those interested, the line I needed to add to my batch file was:

    regedt32.exe /e "C:\Documents and Settings\Bruce\My Documents\OEbackup.reg" "HKEY_CURRENT_USER\Identities\{20767E75-E91E-4888-9EE8-7A9F5B90BCD7}\Software\Microsoft\Outlook Express\5.0"

    'regedt32.exe' opens the registry and finds the key, the 'e' switch exports it to a location I designate, in the is case 'My Documents', with a name I created, 'OEbackup.reg'.

    What I did wrong was not was not know it was exporting to a default location (C:\Windows\System32) unless I designated like I did and thus was not copying it. The other thing was that I was trying to export it last instead of first, so the exported key was never being copied. I told it to be exported first, copied to 'My Documents', then to the ZIP - works great!

    The final result is this:
    Code:
    @echo off
    
    rem This deletes the previous backup archive
    
    del C:\backup.zip
    
    rem This exports registry key mail settings, rules, 
    rem sigs to 'My Documents' to be copied
    
    regedt32.exe /e  "C:\Documents and Settings\Bruce\My Documents\OEbackup.reg"  "HKEY_CURRENT_USER\Identities\{20767E75-E91E-4888-9EE8-7A9F5B90BCD7}\Software\Microsoft\Outlook Express\5.0" 
    
    rem This copies the files in the paths to a zip folder on the root drive 
    
    c:\zip -9r C:\backup.zip  "C:\Documents and Settings\Bruce\Application Data\Avant Browser"  "C:\Documents and Settings\All Users\Application Data\Spybot - Search & Destroy"  "C:\Documents and Settings\All Users\Application Data\Symantec"  "C:\Documents and Settings\Bruce\Application Data\Symantec\Shared"  "C:\Documents and Settings\Bruce\Application Data\Microsoft\Address Book"  "C:\Documents and Settings\Bruce\Local Settings\Application Data\Identities\{20767E75-E91E-4888-9EE8-7A9F5B90BCD7}\Microsoft\Outlook Express"  "C:\Documents and Settings\Bruce\Favorites"  "C:\Documents and Settings\Bruce\Desktop"  "C:\Documents and Settings\Bruce\My Documents"  "C:\WINDOWS\system32\drivers\etc "
     

  3. to hide this advert.

Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.