Solved Invalid Syntax running a batch file

November 8, 2012 at 03:14:12
Specs: Windows 7
Hello everyone,

Am trying to create a batch file with the following command in Windows 7:

REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{A711A0A8-6020-4FB1-A477-4E550E2FBE76}Machine\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions /v AllowAdminInstall /t REG_DWORD /d 1

However it is giving an invalid syntax error message. I tried running the command
inside the command prompt as an admin.

Even adding "" does not help. For eg.REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{A711A0A8-6020-4FB1-A477-4E550E2FBE76}Machine\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions /v AllowAdminInstall /t REG_DWORD /d 1" adds a subkey on the left hand side named /v AllowAdminInstall /t REG_DWORD /d 1 instead of creating a value named AllowAdminInstall on the right hand side of the regedit window.

Please help


See More: Invalid Syntax running a batch file

Report •

#1
November 8, 2012 at 03:29:26
✔ Best Answer
Problem Solved

The solution is:

REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{A711A0A8-6020-4FB1-A477-4E550E2FBE76}Machine\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions" /v AllowAdminInstall /t REG_DWORD /d 1

Thanks for reading :)


Report •
Related Solutions


Ask Question