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.

20 lines
495 B

  1. on error resume next
  2. set events = GetObject("winmgmts:").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. set NTEvent = events.nextevent (1000)
  9. if err <> 0 then
  10. WScript.Echo Err.Number, Err.Description, Err.Source
  11. else
  12. WScript.Echo NTEvent.TargetInstance.Message
  13. end if
  14. exit do
  15. loop
  16. WScript.Echo "finished"