echo off for /d %%i in (*) do ( echo %%i cd %%i git fetch --all cd .. )
判斷子目錄是否有.git資料夾
echo off for /d %%i in (*) do ( cd %%i IF EXIST .git ( echo %%i git fetch --all echo. ) cd .. )
分別統計當前目錄下的每一個子目錄所包含的資料夾個數
@echo off setlocal EnableDelayedExpansion for /d %%i in (*) do ( echo %%i CALL :CountSubFolders "%%~i",value2 echo !value2! 666 echo. ) echo 777 Exit /B 0 :CountSubFolders set count=0 rem echo %~1 111 rem echo %cd% 222 cd %~1 rem echo %cd% 333 for /d %%i in (*) do ( rem echo subfolder %%i set /a count+=1) rem echo %count% 444 set "%~2=%count%" cd.. rem cd rem echo 555