9

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
  • Have you tried it without the square brackets?
    – briantist
    Nov 17, 2014 at 6:47
  • yes i have, and also with quotation marks.
    – Antp
    Nov 17, 2014 at 6:52
  • BTW, if you're working in HKCU, you probably don't need to elevate privileges. Nov 17, 2014 at 19:07

1 Answer 1

13

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .