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.
 
 
 
 
 
 

26 lines
533 B

function MYSINK_OnCompleted(iHResult, objErrorObject, objAsyncContext)
{
WScript.Echo ("Done");
}
function MYSINK_OnObjectReady(objObject, objAsyncContext)
{
WScript.Echo (objObject.Name);
}
var locator = WScript.CreateObject("WbemScripting.SWbemLocator");
var services = locator.ConnectServer();
var sink = WScript.CreateObject("WbemScripting.SWbemSink", "MYSINK_");
services.Security_.ImpersonationLevel = 3;
services.InstancesOfAsync(sink, "Win32_process");
WScript.Echo ("Hanging");