Solved

Change IE Settings with Batch file...

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
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.
In this Experts Exchange video Micro Tutorial, I'm going to show how small business owners who use Google Apps can save money by setting up what is called a catch-all email address in their Gmail accounts. By using the catch-all feature, small busin…

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now