vbs文件
do while true '死循环
on error resume next
set ws = createobject("wscript.shell")
QQprocess="TIM.exe"
check = isProcessExists(QQprocess)
if (check <> true ) then
wscript.sleep 10000
ws.exec """C:\Program Files (x86)\Tencent\TIM\Bin\QQScLauncher.exe""" '启动程序
end if
wscript.sleep 10000
loop
Private Function isProcessExists(strExeName) '监测程序是否存在的方法
strComputer = "."
Set wbemServices = GetObject("winmgmts:\\" & strComputer)
Set wbemObjectSet = wbemServices.InstancesOf("Win32_Process")
For Each wbemObject In wbemObjectSet
namedata = wbemObject.Name
If strExeName = namedata Then
isProcessExists = true
End If
Next
End Function
bat文件 停止这个死循环监控程序
@echo off
taskkill /f /im wscript.exe