有时间在写

@echo off
set THIS_DIR=%~dp0
if "%UPDATE_BASE_DIR%"=="" set UPDATE_BASE_DIR=%THIS_DIR%


set oldv=0
if exist %THIS_DIR%\v.txt (
	for /f %%i in (%THIS_DIR%\v.txt) do (
		set oldv=%%i
	)
)

set oldPath=%cd%
cd %THIS_DIR%

C:\WINDOWS\system32\xcopy.exe /c/E/r/y/s \\xxxxv.txt "%~dp0"  >NUL 2>&1

set newv=1
for /f %%i in (v.txt) do (
	set newv=%%i
)
cd %oldPath%

if %oldv% LSS %newv% call :UpdateMe
echo NoUpdate
goto :eof

:UpdateMe
set oldPath=%cd%
cd /d %UPDATE_BASE_DIR%
echo Update
C:\WINDOWS\system32\xcopy.exe /c/E/r/y/s \\xxx\* "%~dp0" >NUL 2>&1

cd /d %oldPath%
goto :eof

猜你喜欢

转载自blog.csdn.net/g19920917/article/details/42172841