Change IE9 Settings Using Batch Script and Registry Key

Just sharing some hacks I used for a logon script that I created for Internet explorer. Most of the hacks were using registry key, which is pretty simple as long as you know where the keys are.

Change Home Page

To set the home page for IE can’t be easier. For example setting google.com as home page you do this:

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMain]
"Start Page"="http://www.google.com"

Change Search Provider

ie-search-provider

There are two parts to this one, first is adding Google as a search provider option, second is making Google the default search provider.

Each search provider installed has a unique search scope identifier, for example, the one for google is {523578E1-643D-43BB-8840-A021BF2B23AB}.

In this example I am adding google as a search provider option and making it default search provider.

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerSearchScopes{523578E1-643D-43BB-8840-A021BF2B23AB}]
"DisplayName"="Google"
"URL"="http://www.google.com/search?q={searchTerms}&sourceid=ie7&rls=com.microsoft:{language}:{referrer:source}&ie={inputEncoding?}&oe={outputEncoding?}"
"ShowSearchSuggestions"=dword:00000001
"SuggestionsURL"="http://clients5.google.com/complete/search?q={searchTerms}&hl=en-gb&gl=gb&client=ie8&mw={ie:maxWidth}&sh={ie:sectionHeight}&rh={ie:rowHeight}&inputencoding={inputEncoding}&outputencoding={outputEncoding}"
"OSDFileURL"="http://www.iegallery.com/en-gb/AddOns/DownloadAddOn?resourceId=14045"
"FaviconURL"="http://www.google.com/favicon.ico"
"FaviconPath"="C:\Users\oliang\AppData\LocalLow\Microsoft\Internet Explorer\Services\search_{523578E1-643D-43BB-8840-A021BF2B23AB}.ico"

[HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerSearchScopes]
"DefaultScope"="{523578E1-643D-43BB-8840-A021BF2B23AB}"
"DownloadRetries"=dword:00000000
"ShowSearchSuggestionsInAddressGlobal"=dword:00000001
"KnownProvidersUpgradeTime"=hex:7d,ba,31,91,e7,65,ce,01
"Version"=dword:00000003
"UpgradeTime"=hex:09,5f,ee,b3,e4,65,ce,01

Internet Security Settings for the Four Zones

internet-options

The Registry Key for this is located in

HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet SettingsZones

There are 0, 1, 2, 3, 4 sub folders within this folder. Each Folder keeps different settings for different zones:

  • 0 – Computer
  • 1 – Local Intranet
  • 2 – Trusted Site
  • 3 – Internet
  • 4 – Restricted Sites

Easiest thing to do is setup whatever settings you need, and export the corresponding zone folder. To load the settings for that zone you just need to run that registry key file. Easy!

To add a website / domain to a particular zone, like “Trustted Site Zone”, you add the URL / domain to the zones first, then export this registry key.

HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet SettingsZoneMap

For example to add news.bbc.co.uk as Trusted Site

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet SettingsZoneMapDomains]
@=""
[HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet SettingsZoneMapDomainsbbc.co.uk]
[HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet SettingsZoneMapDomainsbbc.co.uknews]
"http"=dword:00000002

Turn On / Off Tool Bar, Favorites Bar, Status Bar

ie9-tools-status-favorites-bar

This one is even easier, they are all in the same registry folder, this is the key values for turnning them all on:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMINIE]
"ShowStatusBar"=dword:00000001
"LinksBandEnabled"=dword:00000001
"AlwaysShowMenus"=dword:00000001

ShowStatusBar is status bar obviously, LinkBandEnabled is the favorites bar, and AlwaysShowMenus is the toolbar. To turn them off, change values to 0.

Running Registry Key Files In Batch Script

You can run a registry key file using this command:

regedit -s \xxx.xxx.xxx.xxxscriptstest.reg

4 thoughts on “Change IE9 Settings Using Batch Script and Registry Key

  1. saraswathi

    Hi Oscar,
    Thanks for giving me the solution to change internet settings. but am not getting clarity my requirement i want to enable JavaScript in ie10 how to achieve this task my using registry key plz give me the solution

    Reply
  2. Michael Carlisle

    I would like to know how to change the registry settings to batch change the security settings. I want to change the Trusted Sites and Intranet to a custom level; where the user authentication is set to use current user name and password. Can you help me with this?

    Reply
  3. Hugo

    Hi Oscar,

    Good post. I am looking at writing a batch file to add a intranet site and then set it as the default provider. Your post is very useful.

    I just wondered, If you are adding Google as a search provider option using this script then how did you know the search identifier was {523578E1-643D-43BB-8840-A021BF2B23AB} in the registry before you added it?

    Cheers.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Are you Robot? *

I only check blog comments once or twice a week, if you want a quick reply you can post your question on this forum IntoFPV.com... You might get a faster response from me there (multirotor related only).