This is a section of the batch file that contains the error. The code runs through when the batch file is called but returns an error when only exit is called. I only want to run a backup batch if certain files are newer than the latest backup.
:compareFileTime
rem some setting of variables
rem ...
if %YearPartX% GTR %YearPartY% exit /b
if %YearPartX% LSS %YearPartY% call bak.bat&exit /b
if %MonthPartX% GTR %MonthPartY% exit /b
if %MonthPartX% LSS %MonthPartY% call bak.bat&exit /b
if %MonthDayPartX% GTR %MonthDayPartY% exit /b
if %MonthDayPartX% LSS %MonthDayPartY% call bak.bat&exit /b
call bak.bat
exit /b
Aucun commentaire:
Enregistrer un commentaire