Windows命令提示字元--尋找名稱包含2015的資料夾

Windows命令提示字元--尋找名稱包含2015的資料夾

我想知道是否可以使用命令提示字元手動找到名稱中包含“2015”的目錄中的資料夾,然後進入該資料夾。

這就是我從中得到的"for /f "delims=" %a in ('dir /s /b /a:d *2015*') do cd %a"

U:\BeaverGames\Mobile\Custom Street Racer\Builds\GooglePlay>cd U:\BeaverGames\Mobile\Custom Street Racer\Builds\GooglePlay\2015-01-20 (2.5.0 RCd)

U:\BeaverGames\Mobile\Custom Street Racer\Builds\GooglePlay\Archive\2015-01-05 (2.5.0)

有沒有辦法縮小範圍,使其不顯示存檔資料夾中的「2015」資料夾?是否可以完全忽略存檔資料夾並僅在Googleplay資料夾中顯示 2015 資料夾?

答案1

是否可以使用找到名稱中包含“2015”的子目錄,然後進入該資料夾?

從命令列:

for /f "delims=" %a in ('dir /s /b /a:d *2015*') do cd %a

在批次檔中:

for /f "delims=" %%a in ('dir /s /b /a:d *2015*') do cd %%a

如何縮小範圍,使其不顯示存檔資料夾中的「2015」資料夾?

如果/s刪除,將不會搜尋子資料夾。

從命令列:

for /f "delims=" %a in ('dir /b /a:d *2015*') do cd %a

在批次檔中:

for /f "delims=" %%a in ('dir /b /a:d *2015*') do cd %%a

進一步閱讀

相關內容