判断程序是否在进程中[来源网络]

Option Explicit
Dim strComputer,objWMIService,colProcessList
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery("Select * from Win32_Process Where Name = 'javaw.exe'")
If colProcessList.Count>0 Then
WScript.Echo "运行"
Else
WScript.Echo "没运行"
End If
Set objWMIService = Nothing
Set colProcessList = Nothing
Wscript.quit

你可能感兴趣的:(网络)