user198989
user198989

Reputation: 4665

Add registry from bat file

I am trying to add registry entry from bat file. I have a reg file that contains

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel]
"HomePage"=dword:00000001

It works if you double click the reg file. However, I need to make the same registry edit from bat file. I have tried this

reg add HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel /v HomePage /t REG_DWORD /d 0 /f

But doesnt work. What is the correct way to do that ? (except running .reg file from bat file)

Upvotes: 1

Views: 369

Answers (1)

Ryan Bemrose
Ryan Bemrose

Reputation: 9266

Put quotes around the key name.

reg add "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel" /v HomePage /t REG_DWORD /d 0 /f

Because "Internet Explorer" and "Control Panel" contain spaces, you need quotes so it is all treated as one parameter.

Upvotes: 2

Related Questions