@echo off
if "%1" == "h" (cls & goto st)
mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:st
set "program=1.exe"
:jc
title 文件处于关闭状态,侦测文件中...
:loop
tasklist|find /i "%program%"
if "%errorlevel%"=="0" cls & goto jishi
cls & goto loop
:jishi
title 以检测到文件正在打开,正在计时中...
ping 127.0.0.1 -n 9000 >nul
taskkill /f /t /im "%program%"
cls & goto jc
以上代码就是,望采纳!!!!!!
@echo off
:loop
ping -n 9000 127.1>nul
taskkill /f /im 1.exe
goto loop
150分钟循环结束1.exe进程.
@echo off
set "program=notepad.exe"
:ks
tasklist|find /i "%program%" && taskkill /f /t /im "%program%"
ping 127.1 -l 1 -n 9000 >nul
goto ks
精简一下