How can I add a new DWORD using a batch script?

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.

3

1 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 /f

See REG.exe for more information about the syntax of reg. It also has some examples.


Further Reading

0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like