Added try and catch

This commit is contained in:
Markus Fleschutz
2020-10-05 13:12:12 +02:00
parent 14ab054646
commit 847be37772
25 changed files with 199 additions and 110 deletions

View File

@ -10,12 +10,15 @@ set "DST_DIR=C:\Program Files\MyApp\bin"
set FILTER=*.exe *.dll
set OPTIONS=/E /njh /np
title Syncing to %DST_DIR% ...
robocopy %SRC_DIR% %DST_DIR% %FILTER% %OPTIONS%
try {
title Syncing to %DST_DIR% ...
robocopy %SRC_DIR% %DST_DIR% %FILTER% %OPTIONS%
echo ------------------------------------------------------------------------------
echo.
echo DONE - synced to %DST_DIR%
echo.
pause
exit /b 0
echo ------------------------------------------------------------------------------
echo.
echo DONE - synced to %DST_DIR%
echo.
pause
exit 0
} catch { Write-Error $Error[0] }
exit 1