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.

21 lines
628 B

  1. //Create a class in CIMOM to generate events
  2. var t_Service = GetObject("winmgmts:root/default");
  3. var t_Class = t_Service.Get();
  4. t_Class.Path_.Class = "EXECNQUERYTEST00";
  5. var Property = t_Class.Properties_.Add ("p", 19);
  6. Property.Qualifiers_.Add ("key", true);
  7. t_Class.Put_();
  8. var t_Events = t_Service.ExecNotificationQuery
  9. ("select * from __instancecreationevent where targetinstance isa 'EXECNQUERYTEST00'");
  10. while (true) {
  11. WScript.Echo ("Waiting for instance creation events...\n");
  12. var t_Event = t_Events.NextEvent (1000);
  13. WScript.Echo ("Got an event");
  14. break;
  15. }
  16. WScript.Echo ("Finished");