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.

30 lines
643 B

  1. use Win32::OLE;
  2. use Win32::OLE::Enum;
  3. sub MYSINK_OnCompleted(iHResult, objErrorObject, objAsyncObject, objAsyncContext)
  4. {
  5. $WScript->Echo("Done");
  6. }
  7. sub MYSINK_OnObjectReady(objObject, objAsyncObject, objAsyncContext)
  8. {
  9. $WScript->Echo("OnObjectReady");
  10. }
  11. $services = Win32::OLE->GetObject('winmgmts:');
  12. $sink = $WScript->CreateObject("WbemScripting.SWbemSink", "MYSINK_");
  13. $services->{Security_}->{ImpersonationLevel} = 3;
  14. $ret = $services->GetAsync(sink, "Win32_process");
  15. $WScript->Echo("Hanging");
  16. #$str = $cls->{Path_}->{Path};
  17. #print "class: $str\n";
  18. #$WScript->Echo("class: $str\n");