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