The .reg file is just a standard text file, which can be edited with a text editor like Notepad. The syntax in the .reg file allows one to add, update and remove registry entries from the Windows registry. When using the Registry Editor to export a registry value, then it will save the registry values in a .reg file, and then one can edit the .reg file or import it on a another computer.
To add / change a value in the registry:
To delete a value in the registry (Notice the "-"):
"MyEnvironmentVariable" = "Hello"
To delete key with all its sub-keys (Notice the "-"):
Note it is possible to apply a registry file silently without user interaction, by using this command line parameter:
Note another option for modifying the registry from the command line is to use the utility Reg.exe (Can be found in Ressource Kits). Run Reg.exe /? to see how it is used.
Regedit.exe /S <filename>.reg