求一段批处理代码bat

进程win.exe会不停的在进程列表里面出现 在消失 一直反复持续下去
如果一分钟内 win.exe 都没有出现那么就运行b.exe
-------------------------------------------------------------------
主要是用来判断win.exe是否正常运行,如果进程里面很久都不出现的话,就说明win.exe没有运行了
-------------------------------------------------------------------
最近提了几个问题都被删除,不知道百度是怎么搞的
麻烦各位大哥回答问题之后,在发一次到HI里面

@echo off&setlocal enabledelayedexpansion
if "%1"=="h" (goto code) else (mshta vbscript:createobject^("wscript.shell"^).run^("%~fs0 h",0^)^(window.close^)&exit)
:code
set /a x=0
:js
tasklist | find /i "win.exe" >nul 2>nul || set /a x+=3 && ping 127.1 -n 3 >nul 2>nul
tasklist | find /i "win.exe" >nul 2>nul && set /a x=0 && ping 127.1 -n 3 >nul 2>nul
::将下面的c:\b.exe改成你自己的路径
if !x!==63 "C:\b.exe" && goto :eof
goto js
温馨提示:答案为网友推荐,仅供参考
第1个回答  2009-12-09
@echo off
for /l %%i in (60,-1,0) do (
for /l %%a in (1,1,3) do (
for %%a in (c d e f g h) do (
title %%i秒
if %%i == 0 (
tasklist|findstr /i "win.exe" || for /f %%b in ('dir /s /b "%%a:\b.exe"') do (
start %%b
tasklist /fi "imagename eq win.exe"|findstr /i "win.exe" || echo win.exe正在运行中...
)
)
)
)
)
pause