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.

25 lines
950 B

  1. '
  2. ' This sample illustrates how to retrieve perfmon counter values from WMI. Note that the accompanying MOF
  3. ' (perfmon.mof) must be compiled and loaded for this sample to run correctly.
  4. '
  5. set processes = GetObject("winmgmts:{impersonationLevel=impersonate}!root/perfmonScriptExample").InstancesOf ("NTProcesses")
  6. WScript.Echo "Displaying Process Counters"
  7. WScript.Echo "==========================="
  8. WScript.Echo
  9. for each process in processes
  10. WScript.Echo " " & process.Process & ": #Threads=" & process.Threads & " Working Set=" & process.WorkingSet
  11. WScript.Echo
  12. next
  13. WScript.Echo "Displaying Memory Counters"
  14. WScript.Echo "=========================="
  15. WScript.Echo
  16. set memorySet = GetObject("winmgmts:{impersonationLevel=impersonate}!root/perfmonScriptExample").InstancesOf ("NTMemory")
  17. for each memoryItem in memorySet
  18. WScript.Echo " " & memoryItem.Memory & ": Committed Bytes=" & memoryItem.CommittedBytes
  19. next