4 replies
by wesley.chin Accepted solution
by bizzo Accepted solution
If you want to add just a single key, you can use the REG ADD command.
here's some examples from reg add /?
REG ADD \\ABC\HKLM\Software\MyCo
Adds a key HKLM\Software\MyCo on remote machine ABC
REG ADD HKLM\Software\MyCo /v Data /t REG_BINARY /d fe340ead
Adds a value (name: Data, type: REG_BINARY, data: fe340ead)
REG ADD HKLM\Software\MyCo /v MRU /t REG_MULTI_SZ /d fax\0mail
Adds a value (name: MRU, type: REG_MUTLI_SZ, data: fax\0mail\0\0)
REG ADD HKLM\Software\MyCo /v Path /t REG_EXPAND_SZ /d %%systemroot%%
Adds a value (name: Path, type: REG_EXPAND_SZ, data: %systemroot%)
Notice: Use the double percentage ( %% ) inside the expand string
by wesley.chin Accepted solution
Thanks for the reply.
Is there a confirmation prompt when the command is executed in a reg file?
by bizzo Accepted solution
If the registry key is already there it will prompt to see if you want to overwrite it, unless you use the /f switch.
To add a string value, use the REG_SZ datatype.
the last time I needed to use this was to add a system variable. This was the command I used in the batch file.
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v OPS-PACK /t REG_SZ /d C:\Ops\Pack /f
Which, broken down, adds the key OPS-PACK with string value C:\Ops\Pack and forces overwrite, i.e. no prompt.
This discussion is closed to new replies.
Trending Windows Forum posts
Sort by Trending