4

I'm learning the registry with vbscript on the side. I would like to know would I check the strValuname and dwValue of the internet explorer protected mode feature through the use of vbscript?

I tried searching the registry on the strKeyPath to no avail. I was also not able to find the registry path for

"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableMIC"

I was using windows7 when i couldn't find the above registry location.

Thanks

Sebass van Boxel
  • 2,514
  • 1
  • 22
  • 37
yoshi594
  • 61
  • 1
  • 1
  • 2
  • 1
    [The documentation for `URLACTION_LOWRIGHTS`](http://msdn.microsoft.com/en-us/library/ie/ms537183(v=vs.85).aspx#Extensibility) says under "Registry keys": "This information is for reference only. You should not directly manipulate the registry because information stored in the registry might not always be stored in the same location." You should use GetZoneActionPolicy. – Raymond Chen Mar 01 '12 at 18:03

3 Answers3

14

Here is a small vbs script which disables the protected mode for all four areas:

Const HKEY_CURRENT_USER = &H80000001

strComputer = "."

Set ScriptMe=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
    strComputer & "\root\default:StdRegProv")

'Disable protected mode for local intranet'
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1\"
strValueName = "2500"
dwValue = 1
ScriptMe.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue

'Disable protected mode for trusted pages'
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2\"
strValueName = "2500"
dwValue = 3
ScriptMe.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue

'Disable protected mode for internet'
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\"
strValueName = "2500"
dwValue = 3
ScriptMe.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue

'Disable protected mode for restricted sites'
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\4\"
strValueName = "2500"
dwValue = 3
ScriptMe.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue

Save it to a *.vbs and double click it to run it. From commandline use this command:

cscript.exe PATH_TO_THE_VBS_FILE

Finally if you want to do it manually in the registry with regedit, 0 to enable, 3 to disable, the DWORD with the name 2500 in following folders:

protected mode for local intranet

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1\

protected mode for trusted pages

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2\

protected mode for internet

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\

protected mode for restricted sites

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\4\
Sven Ruchti
  • 231
  • 3
  • 5
  • Is `&H80000001` the address for where the current user value is stored? Also, how come your `dwValue` is `1` for `Zone 1`? Shouldn't it be `3` to disable? – B.K. Sep 14 '14 at 04:40
6

You can do this by reading the '2500' key at

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3

Where 3 means protected mode is disabled and 0 means enabled.

Smeiff
  • 259
  • 1
  • 6
  • 17
Martijn Lentink
  • 505
  • 6
  • 9
  • 1
    I assume you meant, 3 means enabled and 0 means disabled? I have edited it for you. – Erx_VB.NExT.Coder Aug 26 '12 at 19:08
  • 5
    `3` means disabled and `0` enabled!!! I just tested this in all zones. I changed the edit back from John Conde's version... –  Oct 01 '12 at 21:55
2

What exactly are you looking for? Protected Mode is controlled by URLAction 0x2500 which you'll find under the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones keys.

EricLaw
  • 56,563
  • 7
  • 151
  • 196
  • I'm looking for the registry entry for the tick box that is associated to the "Enable Protected Mode" which is visible by going through Tools -> Internet options -> Security. I couldn't find the registry entry you were refering to. Closest to it is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap or HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones. I've looked at them before but couldn't find which one controlled the Enable Protect mode tickbox. – yoshi594 Mar 11 '11 at 01:32