Submitted By: Steve Yandl

Monitors for a registry value change event and notifies you if your Internet Explorer home page choice is changed.

Visual Basic
Edit|Remove
'  Monitor registry for value change indicating that the IE home page has been changed
'  Must monitor the Start Page setting in HKEY_USERS for the logged on user
'  not the proxy that appears in HKCU
'       Steve Yandl

strComputer = "."

Set objWMIService1 = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

'  Determine the Security Identifier string for the current user
Set objNetwork = CreateObject("WScript.Network")
strUser = objNetwork.UserName
strDomain = objNetwork.UserDomain

Set objAccount = objWMIService1.Get _
    ("Win32_UserAccount.Name='" & strUser & "',Domain='" & strDomain & "'")
strSID = objAccount.SID
Set objWMIService1 = Nothing


'  Determine HKEY_USERS subkey path to Internet Explorer settings belonging to the current user
strKeyPath = strSID & "\\SOFTWARE\\Microsoft\\Internet Explorer\\Main"


Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\default")

Set colEvents = objWMIService.ExecNotificationQuery _
    ("SELECT * FROM RegistryValueChangeEvent WHERE Hive='HKEY_USERS' AND " & _
        "KeyPath='" & strKeyPath & "'" & " AND ValueName='Start Page'") 
 
Do
    Set objLatestEvent = colEvents.NextEvent
    Wscript.Echo Now & ": IE home page was just changed."
Loop