- @echo off
- :: --------------------- 检测自己是否已运行 ---------------------
- set title=[%~f0]
-
- set /fi=/fi "imagename eq cmd.exe" /fi "windowtitle eq %title%"
- tasklist %/fi% 2>nul | findstr . >nul && (
- echo "%~f0" 已经运行。按任意键退出...
- pause >nul
- exit /b
- )
-
- title %title%
- :: --------------------- / 检测自己是否已运行 ---------------------
-
- pause
复制代码
|