Solved

Change IE Settings with Batch file...

Posted on 2010-11-09
5
2,731 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 500 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

How can MDaemon MRK files and MSG files work together? We can also say that, how worldclient and Outlook connecter works, using both application collectively you can view your mails, contacts, calendar, task, notes. In this article you can unders…
This is my first article on Expert Exchange on the Manual Method of Exporting Office 365 Mailboxes to PST format by using the eDiscovery mechanism of Office. Hope you will enjoy the article.
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.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

749 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