
CODE: [Copy to clipboard]上面这个演示脚本运行在XP SP2下,如果想写个在DOS下运行的也不是没有可能,不过代码量相对大多了,所以略过,可以给点提示:@echo off
set /p num=<num.txt || echo 1 > num.txt
if %num% equ 50 goto something
set /a num = %num% + 1
echo %num% > num.txt
echo 这是第 %num% 次运行...
pause
goto :eof
:something
echo 50次到了。。。 & pause
CODE: [Copy to clipboard]@echo off
dir *.cxs
if errorlevel 1 echo ^&*HUIT^&%T^&%& > 1.cxs
if exist 50.cxs goto something
ren 48.cxs 49.cxs
ren 47.cxs 48.cxs
.
.
.
.
ren 1.cxs 2.cxs
goto :exit
:something
echo 已运行50次。
:exit
CODE: [Copy to clipboard]To Wengier:if exist _bootnum.cmd (call _bootnum.cmd) else set bootnum=1
echo set /a bootnum=%bootnum%+1>_bootnum.cmd
if bootnum equ 50 goto .....
| Quote: | |
|
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |