How to make a registry entry with command prompt

batch

How can I make command prompt (batch) add this entry to the registry?

To set the value of the LocalAccountTokenFilterPolicy registry entry

Open the registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System

If the entry LocalAccountTokenFilterPolicy does not yet exist,
right-click System, and then click Edit, New, and DWord (32-bit)
value. Type the name LocalAccountTokenFilterPolicy, and then set its
value to 1.

It says i need to navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System and create a new DWord (32-bit) named LocalAccountTokenFilterPolicy with the value of 1

Any help is greatly appreciated!

Best Answer

@echo off
reg add HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\POLICIES\SYSTEM /V LocalAccountTokenFilterPolicy /t REG_DWORD /d 1
if %errorlevel%==0 echo Key added successfully
pause
exit

--RUN THE SCRIPT AS ADMINISTRATOR.

Related Question