Avatar of CCG3
CCG3
Flag for United States of America asked on

Change IE Settings with Batch file...

Hello all,

What I am trying to do is create a batch file that I can send to remote users that they can run to automatically change a few Internet Options for them.

I need to add a domain to the trusted sites list as https and I need to set the “Initialize and script ActiveX controls not marked as safe for scripting” to Enabled.

I can set the ActiveX with this line of code with no problems…

reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2" /v "1201" /t REG_DWORD /d 0 /f

However when I try to add a new domain as https I get an Error: Invalid Key Name
What I am running is 2 lines of code…
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\msn.com"
reg add [[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\msn.com\]"https"=dword:00000002]
The first line adds the domain but the second line should add the https value and that is where I am getting my error.

I am sure this is a simple syntax error. Can anyone help me with this? I would really appreciate it!! Thanks in advance!
Internet / Email SoftwareMicrosoft DOSWindows XPEmail Software

Avatar of undefined
Last Comment
johnb6767

8/22/2022 - Mon
jakethecatuk

if you have cut and pasted your script straight into the post, then I can see the problem straight away.

before HTTPS, you have got the bracket the wrong way round.
]"https"=dword:00000002]

should be

["https"=dword:00000002]
CCG3

ASKER
Thanks for the reply Jake but I tried that and got the same error. I have tired it with the brackets without the brackets everything that I can think of.
ASKER CERTIFIED SOLUTION
johnb6767

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
CCG3

ASKER
Thanks John! this is what I settled on and it seems to work....

reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\YourSite.com" /v https /t reg_dword /d 00000002

I am leaving the www off because I want everything not just www for that domain.

thanks for the help!
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
johnb6767

NP!