代码如下:
1.HandleConfig.bat, 读一个ini,然后同时调用copy.bat,copy2.bat,test.bat:
@echo off
for /f "tokens=1,2 delims== " %%a in (Config.ini) do (
if /i "%%b" equ "Y" (
set %%a=Y
>>config2.ini echo %%a=N
) else (
>>config2.ini echo %%a=%%b
if /i "%%b" neq "N" set %%a=%%b
)
)
move /y config2.ini Config.ini
if defined PubBackup call copy.bat %PubBackupDateTime%
if defined Publish call copy2.bat %PublishDateTime%
if defined UpdateServerB call test.bat %PublishDateTime%
2.copy.bat
@echo off
for /f "delims=" %%a in (pathConfig.ini) do set "%%a"
set dates=%~1
IF EXIST "%AServerWebPath%" rd /s /q "%AServerWebPath%"
start /b/wait xcopy /s/h/r/y/c "%cmsWebPath%\*.*" "%AServerWebPath%\">"%publishLogPath%"\%dates%.log
start ReturnBatResult.bat "Publish"
goto :eof
exit