放在启动目录下
每次重启自动运行,在自身后面重定向一个:1
批处理读取自身判断 :1的个数。如果满3次 删除自身。
演示版
注意,结尾处别转行,这样接数字计算比较方便~
@echo off
call :count
if %a% lss 3 (set /p=+1>>%0<nul &echo,shutdown -r -t 30) else (echo,del %0)
pause
exit
:count
set /a a=0
Last edited by 523066680 on 2009-9-11 at 10:45 ]
Put it in the startup directory. Automatically run every time it restarts, and redirect a :1 after itself. The batch script reads itself to judge the number of :1. If it reaches 3 times, delete itself.
Demo version
Note, don't make a line break at the end, so that it's more convenient for digital calculation~
@echo off
call :count
if %a% lss 3 (set /p=+1>>%0<nul &echo,shutdown -r -t 30) else (echo,del %0)
pause
exit
:count
set /a a=0
Last edited by 523066680 on 2009-9-11 at 10:45 ]