' Monitor process start trace events.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessStartTrace = objWMIService.ExecNotificationQuery _
("SELECT * FROM Win32_ProcessStartTrace")
WScript.Echo "Waiting for process to start ..."
Do
Set objLatestEvent = colProcessStartTrace.NextEvent
WScript.Echo
Wscript.Echo "Process Name: " & objLatestEvent.ProcessName
Wscript.Echo "Process ID: " & objLatestEvent.ProcessId
Wscript.Echo "Time: " & objLatestEvent.TIME_CREATED
Loop