这也可以阅读“为什么我不能让我的batch file中的命令工作。”
当我尝试使用该命令时:
FOR /F "tokens=1-4 delims=/ " %%a in ('something cool') DO something else cool %%a %%b %%c
它不工作! 我越来越:
%% a在这个时候是意外的
这是因为在命令提示符下执行此操作时需要单个%,而在batch file中执行该操作时需要双%%。
示例命令行:
FOR /F "tokens=1-4 delims=/ " %a in ('something cool') DO something else cool %a %b %c
示例batch file:
FOR /F "tokens=1-4 delims=/ " %%a in ('something cool') DO something else cool %%a %%b %%c