
You could also use the value 1 to assign a site to the Intranet Sites zone the value 3 to assign a site to the Internet Sites zone or the value 4 to assign a site to the Restricted Sites zone.įinally we use the SetDWORDValue method to create our new registry value. In the world of Internet Explorer, the 2 represents the Trusted Sites zone. We then assign the value 2 to the variable dwValue. If we want to trust only the ftp protocol, then we’d assign strValueName the value ftp if we want to trust all Internet protocols, then we’d assign strValueName the value * (a single asterisk). This will be the name of our new registry value it also indicates which Internet protocols will be trusted from. In our sample script, we assign the value http to the variable strValueName. Still with us? Having created the registry key, we simply need to create and configure a single registry value. We then call the CreateKey method to create a new registry key () inside Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains. Note the tail-end of the path: that’s where we put, the name of the Web site to be added to the trusted sites. We then assign the following registry path to the variable strKeyPath: Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\ Next we connect to the WMI service and, more specifically, to the Standard Registry Provider. What if you wanted to configure as a trusted site for anyone logging on to the computer? In that case, substitute the constant HKEY_LOCAL_MACHINE for HKEY_CURRENT_USER, and assign HKEY_LOCAL_MACHINE the value &H80000002. This constant will be used to access the HKEY_CURRENT_USER portion of the registry and configure as a trusted site for only the logged-on user. We begin by creating a constant HKEY_CURRENT_USER and setting it to the value &H80000001. ObjReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue ObjReg.CreateKey HKEY_CURRENT_USER, strKeyPath StrKeyPath = “Software\Microsoft\Windows\CurrentVersion\Internet Settings\” _ Set objReg=GetObject(“winmgmts:\\” & strComputer & “\root\default:StdRegProv”) (And, really, who doesn’t want to trust Microsoft?) Here’s a script that adds to the list of trusted sites: On Error Resume Next As it turns out, trusted sites are actually stored in the registry consequently, adding a Web site is simply a matter of creating and configuring a new registry key.
#Allow trusted site internet explorer 8 how to
_FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.Hey, Scripting Guy! How can I add a Web site to the Trusted Sites zone in Internet Explorer? Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
#Allow trusted site internet explorer 8 code
ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.īack up and restore Windows user files _3 - Modified array functions that include support for 2D arrays. I hereby grant any person the right to use any code I post, that I am the original author of, on the forums, unless I've specifically stated otherwise in the code or the thread post. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude Give a programmer the correct code and he can do his work for a day. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.

If I posted any code, assume that code was written using the latest release version unless stated otherwise.
