for循环中的迭代器始终给出最后一个元素批次

问题描述

所以我是批处理脚本的新手,我想要一个这样的for循环:

@echo off
for /L %%i in (1,1,20) do (
    set input_name=input%%i.txt
    echo %input_name%
)

输出为:

input20.txt
input20.txt
input20.txt
input20.txt
input20.txt
input20.txt
input20.txt
input20.txt
input20.txt
input20.txt
input20.txt
.
.
. (20 times)

为什么我总是得到迭代中的最后一个数字而不是1到20?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)