Sunday 18 December 2011

Disable activex popups in all the zones

'****************************************************************************************************************************************

'Zone codes
'----------------------------------------
'0 My computer
'1 Local Intranet Zone
'2 Trusted sites zone
'3 Internet zone
'4 Restricted sites zone

'value settings
'----------------------------------------
' 0-enabled 1-prompt 3-disabled

'Disable activex popup in all the zones
Function ActiveXprompt()

newValue = 0
SettingCode = "1400"
For i = 0 to 4
ChangeIEZoneSetting CStr(i), SettingCode, newValue
Next

End Function

'****************************************************************************************************************************************

'Function to change setting in a specified zone
 

Function changeIEzoneSetting(ByVal ZoneCode,ByVal SettingCode,ByVal newValue)
Dim WshShellSet
Set WshShell=CreateObject("wscript.shell")
KeyPath="HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones"
WshShell.regWrite keyPath&"\"&ZoneCode&"\"&SettingCode,newValue,"REG_DWORD"
 

End Function

'****************************************************************************************************************************************

No comments:

Post a Comment