在一些幫助下,我最終設法找到了一個FOR循環,用於在計算機中搜索與輸入字符串名稱相同的文件。現在我唯一的問題是,我想讓for循環跳過兩個目錄,而不是一個。它甚至有可能嗎?在FOR循環中跳過多個特定文件夾
for %%a in (C D E F G H U W) do (
for /f "tokens=*" %%b in ('dir /s /b "%%a:\%filename%" ^|findstr /v /i /L /c:"%cd%\directory i want to skip" ') do (
---
---
---
)
)
我試過這種方式,但它似乎並不奏效:
for %%a in (C D E F G H U W) do (
for /f "tokens=*" %%b in ('dir /s /b "%%a:\%filename%" ^|findstr /v /i /L /c:"%cd%\directory i want to skip" ^|findstr /v /i /L /c:"%cd%\ another directory i want to skip" ') do (
---
---
---
)
)