?
Solved

Change IE Settings with Batch file...

Posted on 2010-11-09
5
Medium Priority
?
2,907 Views
Last Modified: 2012-05-10
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!
0
Comment
Question by:CCG3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 23

Expert Comment

by:jakethecatuk
ID: 34094059
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]
0
 

Author Comment

by:CCG3
ID: 34094335
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.
0
 
LVL 66

Accepted Solution

by:
johnb6767 earned 2000 total points
ID: 34094659
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]

Not valid reg add formats. You didnt have the /v /t /or /v switches.... Also, added msn.com to mine as an https, and it added a subkey called "www". If yours doesnt add that, or if you are going to replace msn.com with your own url, please modify accordingly.

Try this one....

reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\msn.com\www" /v "https" /t reg_dword /d 0x2 /f
0
 

Author Comment

by:CCG3
ID: 34094772
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!
0
 
LVL 66

Expert Comment

by:johnb6767
ID: 34099201
NP!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you using email marketing software? If not, you're missing out on effortless marketing and the reaching of desired conversion rates through email marketing software.
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
This Micro Tutorial will demonstrate the easy use of Gmail embedding images in your email so the recipient of your email can view them in context.
This Micro Tutorial demonstrates  how Internet marketers work with competitive analysis data, and a common task in data preparation is creating separate column for domains. You will then extract from a list of URLs.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question