Manipulate the registry from a batch fileTag(s): Misc Prog HowTo
CAUTION! Working with the registry can be dangerous!
REGEDIT is usually known as a GUI tool to search or edit the Windows registry but we can use it in batch file too.
The syntax to update the registry is
REGEDIT.EXE /S importfile.REG
You can use notepad or wordpad to write registry files, you save them with a .reg extension.
The first line in the registry file for XP or 2000 has to be :
Windows Registry Editor Version 5.00
For Win98, ME, or NT 4.0 it's :
REGEDIT4
To create a key
[HKEY_CURRENT_USER\Software\RealHowto]
[HKEY_CURRENT_USER\Software\RealHowto] "MyValue"="howto"
[-HKEY_CURRENT_USER\Software\RealHowto]
[HKEY_CURRENT_USER\Software\RealHowto] "ValueToBeRemoved"=-
[HKEY_CURRENT_USER\Software\RealHowto] "MyValue"=dword:000001
If a semicolon is in front of any line then it will be ignored, it's the way to comment a REG file.
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\RealHowto] ; add a value "MyValue2"=dword:00000001 ; delete a value "MyValue1"=-