“was unexpected at this time.”

前端 未结 4 1881
情歌与酒
情歌与酒 2020-12-08 06:22

I\'m running this command on a batch file:

for %I in (*.txt *.doc) do copy %I c:\\test2

...and it keeps returning:

4条回答
  •  执念已碎
    2020-12-08 07:22

    I ran across a case where I was getting this error from a file that was named *.cmd. The error arose when I tried to access the first argument to the batch command:

    if %1 EQU ""
    

    Once I put quotes around the symbol for the first argument, the warning message went away:

    if "%1" EQU ""
    

提交回复
热议问题