批处理后台运行

if not "%1"=="wind" mshta vbscript:createobject("wscript.shell").run("""%~f0"" wind",vbhide)(window.close)&&exit
::Running in the background


taskkill /f /FI "WINDOWTITLE eq abc"
TITLE abc
::the same process cmd.exe should be terminated


:refind
choice /t 3 /d y /n >nul
::pause *s (/t timeout)
tasklist|find /i "A.exe"
if %ERRORLEVEL% EQU 0 GOTO refind 
if %ERRORLEVEL% NEQ 0 taskkill /f /im B.exe
GOTO refind

你可能感兴趣的:(批处理后台运行)