- @echo off
- set name=程序名
- set prg0=程序1路径
- set prg1=程序1路径
- set prg2=程序1路径
- set prg3=程序1路径
- set prg4=程序1路径
- if "%1"=="t2" (goto :t2) else (start /b %~s0 t2)
- setlocal enabledelayedexpansion
- set/a cnt=0
- :t1 每5分钟打开一个程序
- ping/n 300 127.0>nul
- set/a q=cnt %% 5
- start !prg%q%!
- goto :t1
-
- :t2 每12个小时关闭上方所有程序
- ping/n 43200 127.0>nul
- taskkill /f /im %name%
- goto :t2
复制代码
|