Solved

Change IE Settings with Batch file...

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Email signatures have numerous marketing benefits. Here are 8 top reasons to turn your email signature into a marketing channel.
The purpose of this video is to demonstrate how to set up Lists in Mailchimp. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchimp account. : Click on Lists. Click on Create List Button : Choose the desi…
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, fr…

840 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