防止第二个指定相同进程出现的批处理(bat)实例
原创 ehym @echo off chcp 437 mode con:cols=65 lines=12 SETLOCAL ENABLEDELAYEDEXPANSION for /f "tokens=* DELIMS=" %%z in ('type %0') do (set zzz=%%z) set m=%zzz:~-5,-4% set mm=%zzz:~-20,-19% set mmm=%zzz:~17,1% set mmmm=%zzz:~3,1% set mmmmm=%zzz:~-20,-19% set mmmmmm=%zzz:~-21,-20% echo %m%%mm%: %mmm%%mmmm%%mmmmm%%mmmmmm% title %m%%mm%: %mmm%%mmmm%%mmmmm%%mmmmmm% SETLOCAL DISABLEDELAYEDEXPANSION echo ----Forbid The Same Task---- Ehym Personal set /p program=Please input the task name(Like:cmd): echo fi nding... :math for /f %%a in ('tasklist^|find /c /i "%program%.exe"') do ( ...................... nding... :math for /f %%a in ('tasklist^|find /c /i "%program%.exe"') do ( ......................
下载地址
用户评论