How to add, modify, or delete registry subkeys and values by using a registration entries (.reg) file
Deleting Registry Keys and Values
To delete a registry key with a .reg file, put a hyphen (-) in front of the RegistryPath in the .reg file. For example, to delete the Test subkey from the following registry key:
HKEY_LOCAL_MACHINE\Softwareput a hyphen in front of the following registry key in the .reg file:
HKEY_LOCAL_MACHINE\Software\TestThe following example has a .reg file that can perform this task.
[-HKEY_LOCAL_MACHINE\Software\Test]To delete a registry value with a .reg file, put a hyphen (-) after the equals sign following the DataItemName in the .reg file. For example, to delete the TestValue registry value from the following registry key:
HKEY_LOCAL_MACHINE\Software\Testput a hyphen after the "TestValue"= in the .reg file. The following example has a .reg file that can perform this task.
HKEY_LOCAL_MACHINE\Software\Test"TestValue"=- To create the .reg file, use Regedit.exe to export the registry key that you want to delete, and then use Notepad to edit the .reg file and insert the hyphen.
Back to the top
Renaming Registry Keys and Values
To rename a key or value, delete the key or value, and then create a new key or value with the new name.
Back to the top
Distributing Registry Changes
You can send a .reg file to users in an e-mail message, put a .reg file on a network share and direct users to the network share to run it, or you can add a command to the users' logon scripts to automatically import the .reg file when they log on. When users run the .reg file, they receive the following messages:
Registry EditorAre you sure you want to add the information in path of .reg file to the registry? If the user clicks Yes, the user receives the following message:
Registry EditorInformation in path of .reg file has been successfully entered into the registry.Regedit.exe supports a /s command-line switch to not display these messages. For example, to silently run the .reg file (with the /s switch) from a login script batch file, use the following syntax:
regedit.exe /s path of .reg fileYou can also use Group Policy or System Policy to distribute registry changes across your network. For additional information, visit the following Microsoft Web site:
http://msdn2.microsoft.com/en-us/library/ms954395.aspx (http://msdn2.microsoft.com/en-us/library/ms954395.aspx) Note If the changes work, you can send the registration file to the appropriate users on the network.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment