1

I want to write a VB script that will return the current memory utilisation of a process on a remote machine.

I'm currently getting the info by greping the output of pslist.exe but that's not ideal.

theaxe
  • 119
  • 1
  • 2
  • 11

2 Answers2

5

Could you use Win32_Process. WorkingSetSize?

Set objWMI = GetObject("winmgmts:\\.\root\cimv2")
Set colObjects = objWMI.ExecQuery("Select * From Win32_Process")

For Each Item in colObjects
    WScript.Echo Item.Name & " - " & Item.WorkingSetSize
Next

When I ran this on my local system the WorkingSetSize looked equivilent to the Bytes of mem usage. So you'd divide by 1024 to get Kb.

Rob Haupt
  • 2,104
  • 1
  • 15
  • 24
0

Maybe you can use WMI to remotly read performances conter on the remote machine.

http://msdn.microsoft.com/en-us/library/aa392397(VS.85).aspx

Patrick Cuff
  • 28,540
  • 12
  • 67
  • 94
Wyvern
  • 51
  • 2