“was unexpected at this time.”

前端 未结 4 1892
情歌与酒
情歌与酒 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:02

    If you're running within a batch/cmd file, you need to double the % markers:

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

    The single % variant only works from the command line.

提交回复
热议问题