single line for statement: %%i 'unexpected at this time'

前端 未结 2 1349
礼貌的吻别
礼貌的吻别 2020-12-25 13:55
for /r %%i in (*) do (echo %%i)

Results in

%%i was unexpected at this time

Why?

2条回答
  •  太阳男子
    2020-12-25 14:07

    You must be trying to run the command from the command line and not from within a batch file. Use a single % instead of two when running from the command line.

    for /r %i in (*) do (echo %i)
    

    Type HELP FOR from the command line and read the 3rd paragraph.

提交回复
热议问题