我在批处理文件中有一个 FOR 循环,其中我在 echo 语句中打印计数器值:下面的示例代码:
SET cycles= (%%n+1) ****here n is a variable of value 1
for /l %%n in (1,1,%iterations%) do (
echo This is Iteration no: (%%n+%cycles%)
)
这不起作用,因为它不计算,而是说
For was not expected this time.
我也试过 (%%n+%%cycles) 但它不起作用。
你能帮忙吗?