How can I add a new DWORD using a batch script? I know you need to have a elevated command prompt (I think) which I already have the script for. This is the script I have but it’s not working.
REG ADD HKLM\Software\Microsoft\windows\CurrentVersion\Policies\system] [/v LocalAccountTokenFilterPolicy] [/t REG_DWORD] [/d 1][/f]And yes I am using this for PStools.
31 Answer
This is the script I have but it’s not working.
REG ADD HKLM\Software\Microsoft\windows\CurrentVersion\Policies\system] [/v LocalAccountTokenFilterPolicy] [/t REG_DWORD] [/d 1][/f]
The [ and ] are not meant to be part of the command (it looks like you copied some text from a page explaining the command and did not remove them). These characters are used as delimiters (grouping characters) when explaining how to use the reg command.
Try the following:
REG ADD HKLM\Software\Microsoft\windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /fSee REG.exe for more information about the syntax of reg. It also has some examples.
Further Reading
- An A-Z Index of the Windows CMD command line - An excellent reference for all things Windows cmd line related.
- reg - Read, Set or Delete registry keys and values, save and restore from a .REG file.