# Tech Help: want to write a script to modify Internet Explorer settings

**URL:** <https://boards.straightdope.com/t/tech-help-want-to-write-a-script-to-modify-internet-explorer-settings/499265>\
**Category:** Factual Questions\
**Created:** [June 9, 2009, 10:50pm UTC](https://boards.straightdope.com/t/tech-help-want-to-write-a-script-to-modify-internet-explorer-settings/499265 "2009-06-09T22:50:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rack-a-Bones](https://avatars.discourse-cdn.com/v4/letter/r/77aa72/32.png) [@Rack-a-Bones](https://boards.straightdope.com/u/Rack-a-Bones)\
**Post date:** [June 9, 2009, 10:50pm UTC](https://boards.straightdope.com/t/tech-help-want-to-write-a-script-to-modify-internet-explorer-settings/499265/1 "2009-06-09T22:50:43Z")

</div>

In order to use an online application that my company makes it is necessary to do a few “tweaks” to IE settings. Here is what needs to be done:

In Tools \> Internet Options \> Security Tab

1. Add two addresses to Trusted Sites
2. In the custom level settings for trusted sites enable some of the settings that IE has disabled by default

In Tools \> Internet Options \> Privacy Tab  
Add a site to the allowed sites for pop ups  
Any ideas on how I could write this? What scripting language to use? Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![Jragon](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jragon](https://boards.straightdope.com/u/Jragon)\
**Post date:** [June 9, 2009, 11:12pm UTC](https://boards.straightdope.com/t/tech-help-want-to-write-a-script-to-modify-internet-explorer-settings/499265/2 "2009-06-09T23:12:03Z")

</div>

No script needed, but it requires you to add these manually at least once. I should point out that it requires access to the registry, which may or may not be an issue:

1.) Add the required sites to the correct places by hand.  
2.) Start Menu -\> Run -\> Regedit (or on Vista just type it into the bar)  
3.) Navigate to

HKEY\_CURRENT\_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains

Right click on the folder and select **export**. Name this something like “TrustedSites” or whatever.

4.) Do the same for

HKEY\_CURRENT\_USER\Software\Microsoft\Internet Explorer\New Windows\Allow

Which is your popup exceptions registry.

5.) Now any time you need to readd these entries simply execute these two files, if you want to be fancy you could add a batch file (.bat) to your Startup folder that simply has the path of the two files written in it, but that’s rather unnecessary.

---

<div class="post-metadata">

**Author:** ![Jragon](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jragon](https://boards.straightdope.com/u/Jragon)\
**Post date:** [June 9, 2009, 11:19pm UTC](https://boards.straightdope.com/t/tech-help-want-to-write-a-script-to-modify-internet-explorer-settings/499265/3 "2009-06-09T23:19:30Z")

</div>

Oops, I think I misread your question. I thought your computer cleared your settings on logoff (some people do that) or something and just needed a way to reset YOUR settings every time. If this is for a generic user disregard that.

Edit: Adding it will be the same principle though, you’ll just need a small script in whatever language you’re comfortable with to add things to the correct keys.

---

<div class="post-metadata">

**Author:** ![Jragon](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jragon](https://boards.straightdope.com/u/Jragon)\
**Post date:** [June 9, 2009, 11:31pm UTC](https://boards.straightdope.com/t/tech-help-want-to-write-a-script-to-modify-internet-explorer-settings/499265/4 "2009-06-09T23:31:37Z")

</div>

Ha! Found one for VB Script:

```auto

On Error Resume Next

Const HKEY_CURRENT_USER = &H80000001

strComputer = "."
Set objReg=GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\" _
    & "ZoneMap\Domains\[siteNameHere]"

objReg.CreateKey HKEY_CURRENT_USER, strKeyPath

strValueName = "http"
dwValue = 2

objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue

```

If you want it done for the machine instead of the logged on user change all HKEY\_CURRENT\_USER to HKEY\_LOCAL\_MACHINE and the value of the constant to  
&H80000002.

From [Microsoft](http://www.microsoft.com/technet/scriptcenter/resources/qanda/feb05/hey0214.mspx), they may have your other solutions there too but I haven’t found them, you can look if you want.

---

<div class="post-metadata">

**Author:** ![Rack-a-Bones](https://avatars.discourse-cdn.com/v4/letter/r/77aa72/32.png) [@Rack-a-Bones](https://boards.straightdope.com/u/Rack-a-Bones)\
**Post date:** [June 10, 2009, 12:30am UTC](https://boards.straightdope.com/t/tech-help-want-to-write-a-script-to-modify-internet-explorer-settings/499265/5 "2009-06-10T00:30:43Z")

</div>

Wow. Cool. I don’t think I stated my intended usage for this. Any new computer that has never run our software needs these done just one time (or after any updates to IE that wipes out old settings)

We get so many clients that are so computer illiterate or so paranoid about changing a setting that something that takes 1-2 minutes for me takes them forever or is just impossible.

So I want something to send these clients they can put on their desktop, execute, then delete off their machine.

Thanks for your input! If I can pull this off I’ll be a hero at work.
