Chapter 5: Using WMI Events 113
Microsoft Windows XP and Windows Server 2003, it is already compiled into the root\
subscription namespace. The Scrcons.mof file is located in the directory %System-
Root%\System32\WBEM. The CreatePermanentEventRunScript.vbs script uses the Active-
ScriptEventConsumer. We discussed the major concepts of this script earlier.
CreatePermanentEventRunScript.vbs
strcomputer = "mred" "name of target computer. Can not use "."
wmiNS = "\root\subscription"
eClass = "__instanceModificationEvent" "type of event to obtain
tClass = ""win32_service"" "wmi class to monitor
tName = ""Schedule"" "name property of target class
qQuery ="select * from " & eClass & " within 10 where targetInstance isa "_
& tClass
& " and