1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Making a .reg file

Discussion in 'Windows 7' started by mightymo77, Nov 11, 2009.

Thread Status:
Not open for further replies.
  1. mightymo77

    mightymo77 Thread Starter

    Jun 12, 2007
    How do you create a reg file to edit the registry to do the following:

    It's kind of a pain to do that manually after a clean format, would love to have a reg file to do it for me.
  2. pjhutch


    Aug 23, 2005
    You can create a batch file with a series of REG.EXE commands to add, delete or modify registry keys. E.g.

    REG ADD HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell /v BagMRU /t DWORD /d 10000
    add a new DWORD called BagMRU and sets it to 10000.

    REG DELETE HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags

    Delete the Bags Key and sub-entries.
  3. Squashman

    Squashman Trusted Advisor

    Apr 4, 2003
    Batch or once you have done it manually, just export the registry keys to back them up. Then if you ever clean install again, just merge them back in.
  4. TheOutcaste


    Aug 7, 2007
    I agree with Squashman, export the keys right after doing the configuration, then create a single file to do all the work on a new install, or to reset the current settings to your default.

    Deleting the Bags and BagsMRU keys deletes all the customizations. I believe that the "Bags" that store the info are created in the order that folders are opened. If you export the current settings, they may include settings for folders that won't exist on a new install. I'm not sure what effect that would have.

    You should be able to delete the keys, then customize one of each folder type, using folders that exist on a new install. Then export the Bags and BagsMRU keys, remove the Windows Registry Editor Version 5.00 line from the start of each file (it should only appear once, at the start of the file), then paste the content into the the reg file shown below, replacing the lines in red.
    This adds/sets the FolderTypes value, and deletes the Bags and BagsMRU keys. Then merges the settings you've pasted in. The BagsMRU Size value is added last, in case it's included in the exported keys you paste in.

    So you would replace the Red lines with the contents for the appropriate file.

    The minus sign is how you delete a key in a .reg file.
    Windows Registry Editor Version 5.00
    ;Set size to 10,000 (2710 Hex)
    [HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell]
    "BagMRU Size"=DWORD:00002710
    ;Deletes these keys
    [-HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags]
    [-HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU]
    ;paste the exported Bags file here
    [COLOR=DarkRed][HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags][/COLOR]
    ;paste the exported BagsMRU file here
    [COLOR=DarkRed][HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagsMRU][/COLOR]
    ;Sets default type for folders
    [HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\ Windows\Shell\Bags\AllFolders\Shell]
    The reg add/delete commands require data that contains spaces to be quoted, and should use the /F switch if you don't want to be prompted when deleting, or if the value already exists, so proper syntax would be:
    REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell" /V "BagMRU Size" /T DWORD /D 10000 /F
    REG DELETE "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags" /F
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/876561