查看正在使用内存大小的vbs脚本
GSet wmiService = GetObject("winmgmts:\\.\root\cimv2")
Set wmiObjects = wmiService.ExecQuery("SELECT * FROM CIM_OperatingSystem")
For Each wmiObject In wmiObjects
all=wmiObject.TotalVisibleMemorySize
over=wmiObject.FreePhysicalMemory
next
use=all-over
msgbox use/1024/1024&"GB内存使用中"
举例脚本(可直接复制至你的vbs文件里)
Set wmiService = GetObject("winmgmts:\\.\root\cimv2")
Set wmiObjects = wmiService.ExecQuery("SELECT * FROM CIM_OperatingSystem")
For Each wmiObject In wmiObjects
all=wmiObject.TotalVisibleMemorySize
over=wmiObject.FreePhysicalMemory
next
use=all-over
msgbox use/1024/1024&"GB内存使用中(此代码由vbs脚本大全网开发)"