批处理文件中可引用的参数为%0~%9,%0是指批处理文件的本身,也可以说是一个外部命令;%1~%9是批处理参数,也称形参;而替换形参的实参若超过了批处理文件中所规定数值(9个)且想在批处理文件中应用这些实参的话,就需要自己shift实现了! ```bat echo off type nul > D:\args_dump.txt echo args list: :LOOP set index=%1 if %index%! == ! goto END echo %index% echo %index% >> D:\args_dump.txt shift goto LOOP :END ``` # 参考 * [bat 传递超过10个参数(bat参数遍历)](https://www.cnblogs.com/dongzhiquan/p/3694907.html) * [在批处理文件中遍历参数的一种实现](https://blog.csdn.net/studying/article/details/6722058)