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

 

相关文章:

  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
猜你喜欢
  • 2021-05-28
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
  • 2021-11-13
  • 2022-12-23
  • 2021-10-08
相关资源
相似解决方案