0
我可以做DOS批处理文件while循环这样的结尾:控制都开始同时使用可变循环在Windows蝙蝠脚本
@REM initialize test value to be "true"
@SET intCounter=1
:while
@REM test condition
@IF %intCounter% GTR 10 (GOTO wend)
@REM procedure where condition is "true"
@echo %intCounter%
@REM set new test value
@SET /a intCounter=intCounter+1
@REM loop
@GOTO while
:wend
@PAUSE
这将循环十倍。 我的问题是两个折叠。
我怎样才能控制循环的结束。我试过set end = 1,用%end%替换10,这是行不通的。
如何从键盘读取输入并将它们设置为iniCounter并结束。
非常感谢。
谢谢。如果我成功了,我会立即尝试并标记答案。 –
'code'@ set end = 5 'code':while 'code'@ IF%intCounter%GTR%end%(GOTO wend) 最适合我的结果。我不知道为什么。我使用完全相同的代码。可能只是错字或键盘。另一个的输出是有点线。像c:\()1然后c:\()2。 ... –