- If (Lcase(Right(Wscript.FullName,11)) = "wscript.exe") Then
- CreateObject("WScript.Shell").Run("%Comspec% /C " &Chr(34)&"Cscript.exe //NoLogo "&Chr(34)& Wscript.ScriptFullName &Chr(34))
- Wscript.Quit
- End If
-
- aExe = "notepad.exe"
- Set Wmi = GetObject("Winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
-
- Do
- Set A = Wmi.Execquery("Select * From Win32_Process Where Name = '" & aExe & "'")
- For Each B In A
- Wscript.Echo "映像路径:" &vbtab& B.CommandLine
- Wscript.Echo "内存使用:" &vbtab& FormatNumber(B.WorkingSetSize/1024,0) & " K"
- Wscript.Echo "虚拟内存:" &vbtab& FormatNumber(B.PageFileUsage/1024,0)& " K"
- Wscript.Echo
- Next
- Wscript.Sleep 1000
- Loop
复制代码
CPU使用就不知道是哪个属性 |