How can I add a new DWORD using a batch script?
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
- 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.
Related videos on Youtube
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, 2022Comments
-
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 over 9 yearsHave you tried it without the square brackets?
-
Antp over 9 yearsyes i have, and also with quotation marks.
-
G-Man Says 'Reinstate Monica' over 9 yearsBTW, if you're working in HKCU, you probably don't need to elevate privileges.
-