' 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
search for scripts

VbsEdit contains all these sample scripts!





Home   Scripts

Copyright © 2001-2020 adersοft