在我的批处理文件中,我有几个for循环。批处理:在多个循环中多次使用变量for
exampleInputDir\weapon\%character%\thing1
\thing2
\thing3
每一件事#文件夹包含motion.mtable文件
FOR /R "C:\exampleInputDir\weapon\%character%\" %%G IN (motion.mtable) DO (
FOR %%b in ("%%~dpG\.") DO set "weaponname=%%~nxb"
FITD -le "%G%" -o "C:\exampleOutputDir\%character%\%weaponname%"
)
如果不清楚是什么,我试图做的,我需要的%G%变量不止一次,并且对于其中一次,我需要稍微更改并将其放入另一个变量,以便我可以在一个命令中调用它两次。
如果有什么不清楚的只是让我知道,我会尽力澄清! 谢谢!
编辑:我想这最后的命令是:
FITD -le "exampleInputDir\weapon\%character%\thing#\motion.mtable" -o "C:\exampleOutputDir\%character%\thing#"
,我想的命令,因为weaponname
和%%~nxb
通过thing1,thing2和thing3
等一下,delayedexpansion陷阱?我需要delayedexpansion吗? 非常感谢你,我现在就放弃它:) – Yudowat