【发布时间】:2011-07-11 11:46:32
【问题描述】:
我有一个批处理文件,需要传递一个包含管道和空格的参数。由于有空格,传入参数时需要在参数上附加双引号。我需要去掉那些双引号并回显参数。通常,使用 ~ 会让我这样做,但我认为我传入的特定参数会导致问题。如果我这样做:
[test1.bat]
call test2.bat "Account|Access Level|Description"
[test2.bat]
echo %1
echo %~1
然后运行 test1.bat,我得到这个输出:
"Account|Access Level|Description"
'Access' is not recognized as an internal or external command, operable program or batch file.
那么如何去掉双引号,仍然有一个可用的变量呢?
【问题讨论】:
标签: windows batch-file