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.

31 lines
791 B

  1. On Error Resume Next
  2. 'Create a class in CIMOM to generate events
  3. Set t_Service = GetObject("winmgmts:root/default")
  4. Set t_Class = t_Service.Get
  5. t_Class.Path_.Class = "EXECNQUERYTEST00"
  6. Set Property = t_Class.Properties_.Add ("p", 19)
  7. Property.Qualifiers_.Add "key", true
  8. t_Class.Put_
  9. Set t_Events = t_Service.ExecNotificationQuery _
  10. ("select * from __instancecreationevent where targetinstance isa 'EXECNQUERYTEST00'")
  11. if Err <> 0 then
  12. WScript.Echo Err.Number, Err.Description, Err.Source
  13. end if
  14. Do
  15. WScript.Echo "Waiting for instance creation events...\n"
  16. set t_Event = t_Events.NextEvent (1000)
  17. if Err <> 0 then
  18. WScript.Echo Err.Number, Err.Description, Err.Source
  19. end if
  20. WScript.Echo "Got an event"
  21. exit Do
  22. Loop
  23. Wscript.Echo "Finished"