这是我遇到的问题:
@ECHO OFF
REM If this batch file is run in the same directory as "command.exe" then the
REM following line will work.
FOR /F "usebackq" %%A IN (`command.exe "C:\File Being Passed as a Parameter.txt"`) DO ECHO %%A
REM The following line does not work no matter where this batch file is run.
FOR /F "usebackq" %%A IN (`"C:\Folder With Spaces\command.exe" "C:\File Being Passed as a Parameter.txt"`) DO ECHO %%A
我想把这个批处理文件存储在任何我想要的地方,而不被强迫将其存储在与command.exe相同的文件夹中。 有什么建议吗?
call
命令? - jebcall
的方式才有效。 - jeb