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.

35 lines
845 B

  1. '***********************************************************************
  2. '*
  3. '* WbemSink_OnCompleted
  4. '*
  5. '***********************************************************************
  6. sub WbemSink_OnCompleted(hResult, pErrorObject, pAsyncContext)
  7. WScript.Echo "Final status is:", hResult
  8. end sub
  9. '***********************************************************************
  10. '*
  11. '* WbemSink_OnObjectReady
  12. '*
  13. '***********************************************************************
  14. sub WbemSink_OnObjectReady(pObject, pAsyncContext)
  15. Set pObject = Nothing
  16. end sub
  17. Dim Service
  18. Dim MyObect
  19. Set MySink = Wscript.CreateObject ("Wbemscripting.SWbemSink", "WbemSink_")
  20. Set Service = GetObject ("Winmgmts:")
  21. for i = 1 to 1000
  22. Service.GetAsync MySink, "win32_Service"
  23. next
  24. while true
  25. Service.Get "Win32_Service"
  26. wend