做了一个无限循环的批处理 但是总是到1242次的时候就结束是为什么
批处理吧
全部回复
仅看楼主
level 1
学习闪避 楼主
/*do something*/
if "%1"=="" (set count=0) else set count=%1
echo %count%
set /a count=1+%count%
set CurTime=%time%
set cutDate=%date%
echo time:%cutDate:~0,4%年%cutDate:~5,2%月%cutDate:~8,2%日%CurTime:~0,2%时%CurTime:~3,2%分%CurTime:~6,2%秒    count=%count%*4 >>shuaLog.txt
call %0 %count%

2011年06月08日 06点06分 1
level 11
call是基于堆栈的命令,堆栈有上限
2011年06月08日 07点06分 2
level 1
学习闪避 楼主
啊咧咧 那我该怎么修改
当count=1000(或者任意一个不超过1242的比较大的数字)时call另一个bat, 那个bat再call第一个bat,这样可以把栈清空么
2011年06月08日 07点06分 3
level 11
堆栈只有逐层退出才能结束。
call的退出方式是exit /b或者goto :eof,当然也可以让要自动退出的函数位于文件末尾,这样比较省事。。。。。
解决方法是用goto或者for
for /l %%a in () do (
echo !count!
set /a count+=1
echo time:!Date:~0,4!年!Date:~5,2!月!Date:~8,2!日!Time:~0,2!时!Time:~3,2!分!Time:~6,2!秒     count=!count!*4
)>>shuaLog.txt

2011年06月08日 07点06分 4
1