【发布时间】:2015-03-22 14:52:24
【问题描述】:
我正在尝试从另一个程序传递一个批处理文件的路径。另一个程序使用 BASIC 作为脚本语言。
所以,我通过 Shell() 命令调用批处理文件。
在 shell 命令中,我试图传入一个带有符号“&”的路径。但是,当它到达批处理文件时,批处理文件将 & 视为一种转义序列(我认为)。
例如:
路径:C:\Documents\R&D\Files
Shell("runscript.bat "C:\Documents\R&D\Files"")
在批处理文件中:
variable=~1
echo %variable%
我得到以下输出:
C:文档\R
更新
但是,如果我使用像 C:\Documents\RD\Files 这样的路径
这条路径会通过 find 并且 echo 会打印出来:
C:\Documents\RD\Files
【问题讨论】:
标签: windows batch-file path cmd