Batch file goto not working in for loop

怎甘沉沦 提交于 2019-12-08 03:53:25
RB.

This won't work - you can't jump into a control-flow construct and expect everything to be fine.

Please take a look at (Windows batch) Goto within if block behaves very strangely for a good discussion of why this is a terrible idea.

Rather than using GOTO, you could use NOT to exclude a folder or folders.

for /d %%F in (*) do (
   if /i NOT "%%F"=="ARCHIVE"
       REM do stuff here
)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!