@echo off&setlocal enabledelayedexpansion ::dirs= 要更新的目录 set "dirs= E:aaa, E:bb" set /a all_dir=0 set /a fin_dir=1 ::遍历记录所有文件或目录的数量 for %%i in (%dirs%) do ( cd %%i for /f %%i in ('dir /b "%%i"') do ( set /a all_dir+=1 ) ) echo 一共!all_dir!个目录或文件 ::svn updata and cleanup for %%i in (%dirs%) do ( cd %%i for /f %%i in ('dir /b "%%i"') do ( echo 正在进行第(!fin_dir!/!all_dir!)个目录或文件 set /a fin_dir+=1 @svn update %%~fi echo svn cleanup %%~fi svn cleanup %%~fi ) )