I need a vbscript to add a site to the trusted zone of internet explorer

It has to be added to the hklm so it works for every user.
Who is Participating?
BogeholmConnect With a Mentor Commented:
Read an answar to a similar Q here:

You need to test if you can get it to work by changing script to point to HKLM

HKLM - Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\yourdomain.com

Create a DWORD 'http'.
Krzysztof PytkoConnect With a Mentor Active Directory EngineerCommented:
prepare a reg file (you can export it from existing environment) and use from command-line

reg import <your_reg_file>

I think it's the most simply solution.
Tony MassaConnect With a Mentor Commented:
This script would add "download.microsoft.com" to the list of trusted sites.  You can replace with "*" to add all microsoft.com sites to trusted sites zone.
Const HKEY_CURRENT_USER = &H80000001

strComputer = "."
Set objReg=GetObject("winmgmts:\\" & strComputer &
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet
Settings\" _
    & "ZoneMap\Domains\microsoft.com"

objReg.CreateKey HKEY_CURRENT_USER, strKeyPath

strValueName = "download"
dwValue = 2

objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue

Open in new window

Tony MassaConnect With a Mentor Commented:
Disregard the previous code snippet...EE and my paste function don't agree:
All Courses

From novice to tech pro — start learning today.