Is it possible to modify a registry value (whether string or DWORD) via a .bat/.cmd script?
You can make a .reg file and call start on it. You can export any part of the registry as a .reg file to see what the format is.
Format here:
http://support.microsoft.com/kb/310516
This can be run on any Windows machine without installing other software.
Yes, you can script using the reg
command.
Example:
reg add HKCU\Software\SomeProduct
reg add HKCU\Software\SomeProduct /v Version /t REG_SZ /d v2.4.6
This would create key HKEY_CURRENT_USER\Software\SomeProduct
, and add a String value "v2.4.6" named "Version" to that key.
reg /?
has the details.
Yes. You can use reg.exe which comes with the OS to add, delete or query registry values. Reg.exe does not have an explicit modify command, but you can do it by doing delete and then add.
In addition to reg.exe, I highly recommend that you also check out powershell, its vastly more capable in its registry handling.
@Franci Penov - modify is possible in the sence of overwrite with `/f, eg
reg add "HKCU\Software\etc\etc" /v "value" /t REG_SZ /d "Yes" /f
i wnat a add string value in [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]