VBS 检测进程.
例如.检测到A.exe进程后.结束B.exe和C.exe循环5秒检测一次。不退出VBS脚本。一直死循环检测。谢谢。...
例如. 检测到A.exe进程后.结束B.exe和C.exe 循环 5秒检测一次。不退出VBS脚本。
一直死循环检测。谢谢。 展开
一直死循环检测。谢谢。 展开
1个回答
展开全部
代码如下:
'══代══码══开══始════
set ws=CreateObject("wscript.shell")
Set wmiService = GetObject("winmgmts:\\.\root\cimv2")
A="A.exe"
B="B.exe"
C="C.exe"
DO
Set wmiObjects = wmiService.ExecQuery("SELECT * FROM Win32_process")
For Each wmiObject In wmiObjects
if lcase(wmiObject.name)=lcase(A) then
ws.run "taskkill /f /im "&B,0
ws.run "taskkill /f /im "&C,0
end if
next
WSCRIPT.SLEEP 5*1000
LOOP
'Coded By escortmnm from VBS团队
'══代══码══结══束════
'══代══码══开══始════
set ws=CreateObject("wscript.shell")
Set wmiService = GetObject("winmgmts:\\.\root\cimv2")
A="A.exe"
B="B.exe"
C="C.exe"
DO
Set wmiObjects = wmiService.ExecQuery("SELECT * FROM Win32_process")
For Each wmiObject In wmiObjects
if lcase(wmiObject.name)=lcase(A) then
ws.run "taskkill /f /im "&B,0
ws.run "taskkill /f /im "&C,0
end if
next
WSCRIPT.SLEEP 5*1000
LOOP
'Coded By escortmnm from VBS团队
'══代══码══结══束════
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询