Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
622 B

  1. on error resume next
  2. set events = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecNotificationQuery _
  3. ("select * from __instancecreationevent where targetinstance isa 'Win32_NTLogEvent'")
  4. if err <> 0 then
  5. WScript.Echo Err.Description, Err.Number, Err.Source
  6. end if
  7. do
  8. ' Note that the timeout value below (in ms) passed
  9. ' as an argument can explicitly specified
  10. set NTEvent = events.nextevent ()
  11. if err <> 0 then
  12. WScript.Echo Err.Number, Err.Description, Err.Source
  13. else
  14. WScript.Echo NTEvent.TargetInstance.Message
  15. end if
  16. exit do
  17. loop
  18. WScript.Echo "finished"