Advertisement
vartik

commited.vbs

Apr 24th, 2018
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if WScript.Arguments.Count = 0 then
  2.     strComputer = "."
  3. else
  4.     strComputer = WScript.Arguments(0)
  5. end if
  6. Set wmiObject = GetObject("winmgmts:\\" & strComputer & "\root\cimv2:Win32_PerfFormattedData_PerfOS_Memory=@")
  7. Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
  8. Set colCSItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")
  9. For Each objCSItem In colCSItems
  10.     TotalRAM = objCSItem.TotalPhysicalMemory
  11. Next
  12. Wscript.Echo "Commited: " & (FormatNumber(wmiObject.CommittedBytes / 1073741824,2)) & " GB, Total RAM: " & FormatNumber(TotalRAM / 1073741824,2) & " GB"
  13. rem Wscript.Echo "CommitLimit: " & (FormatNumber(wmiObject.CommitLimit / 1073741824,2)) & " GB"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement