是否有一种简单的方法来检测通过命令行传递到批处理文件的选项/开关?我正在寻找类似于 sh
和 bash
的 getopts
的东西.
最佳答案
不,没有。
(批处理文件只能看到%0、%1、%2等和%*,加上variations such as %~d0, %~f1, %~x2 etc.)
关于batch-file - Windows 批处理文件的 getopts?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3419100/