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

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