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

57,211

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

Share:
57,211

Related videos on Youtube

Antp
Author by

Antp

I am experienced with computers and software, I am a payed hacker and I work for the government. I am also a programmer and a web developer, experienced in Javascript, HTML, PHP, AJAX, and ASP.NET. I also wrote some of the code for jQuery myself. See how awesome i am, I even have my very own command line. New Hack!! ALT+F4

Updated on September 18, 2022

Comments

  • Antp
    Antp over 1 year

    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.

    • briantist
      briantist over 9 years
      Have you tried it without the square brackets?
    • Antp
      Antp over 9 years
      yes i have, and also with quotation marks.
    • G-Man Says 'Reinstate Monica'
      G-Man Says 'Reinstate Monica' over 9 years
      BTW, if you're working in HKCU, you probably don't need to elevate privileges.