
CODE: [Copy to clipboard]@echo off
:loop
tasklist | findstr /i "notepad.exe">nul && call :success || call :failure
pause
goto loop
goto :eof
:success
echo %time%存在!
goto :eof
:failure
echo %time%不存在!
goto :eof
CODE: [Copy to clipboard]一个简单的循环判断进程的方法...@echo off
start x:\Christmas day.exe
goto loop1
:loop1
echo 等待Christmas day.exe
ping 127.1 -n 2 >nul
tasklist|find /i "Christmas day.exe">nul && goto loop2 || goto loop1
:loop2
echo 正在运行Christmas day.exe
ping 127.1 -n 2 >nul
tasklist|find /i "Christmas day.exe">nul && goto loop2 || goto end
:end
call xxx.bat
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |