2013-02-20 83 views
1

我在我的批处理文件中有一个for循环,通过文件夹循环。我想跳过特定的文件夹。我可以用IF语句来做到这一点,但更喜欢GOTO,就像我在下面展示的那样。批处理文件转到循环不工作

for /d %%F in (*) do (
if /i "%%F"=="Archive" goto nextFolder 
REM do stuff here 
:nextFolder 
) 

但上面给我的错误:

) was unexpected at this time 

回答

1

您可以使用NOT来排除一个或多个文件夹,而不是使用GOTO。

for /d %%F in (*) do (
    if /i NOT "%%F"=="ARCHIVE" 
     REM do stuff here 
)