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

前端 未结 2 1348
礼貌的吻别
礼貌的吻别 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:27

    Syntax:

    FOR /R [[drive:]path] %%parameter IN (set) DO command
    

    Need the path before %%i... which is why it's Unexpected

    If you want to do * for current directory, just use ".\" for the path

    for /r ".\" %%i in (*) do (echo %%i)
    

提交回复
热议问题