strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'QQ.exe'")
原脚本这样
然后我想可以这样用。
如: if qq.exe=1 then msgbox "存在"
自己试了下没成功
if jc("qq.exe")=1 then msgbox "存在"
function jc(wr)
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = '"&wr&"'")
end function
[ Last edited by hackhd on 2008-4-2 at 12:16 AM ]
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'QQ.exe'")
原脚本这样
然后我想可以这样用。
如: if qq.exe=1 then msgbox "存在"
自己试了下没成功
if jc("qq.exe")=1 then msgbox "存在"
function jc(wr)
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = '"&wr&"'")
end function
[ Last edited by hackhd on 2008-4-2 at 12:16 AM ]

