2017-08-19 19:36:17 +02:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
:: COPY FILE
|
|
|
|
:: ---------------------------------------------------------------------------
|
|
|
|
|
2020-04-10 13:32:42 +02:00
|
|
|
set "CP_SRC=%~f1"
|
|
|
|
set "CP_DST=%~f2"
|
2017-08-19 19:36:17 +02:00
|
|
|
|
|
|
|
"%~dp0\..\..\..\Prerequisites\CEcho\cecho.exe" white "copy \"%CP_SRC:\=\\%\" to \"%CP_DST:\=\\%\""
|
|
|
|
|
2020-04-10 13:32:42 +02:00
|
|
|
if not exist "%CP_SRC%" (
|
2017-08-19 19:36:17 +02:00
|
|
|
"%~dp0\..\..\..\Prerequisites\CEcho\cecho.exe" red "\nCopy failed: Source file \"%CP_SRC:\=\\%\" not found!\n"
|
|
|
|
pause && exit
|
|
|
|
)
|
|
|
|
|
2020-04-10 13:32:42 +02:00
|
|
|
copy /B /Y /V "%CP_SRC%" "%CP_DST%"
|
|
|
|
|
2017-08-19 19:36:17 +02:00
|
|
|
if not "%ERRORLEVEL%" == "0" (
|
|
|
|
"%~dp0\..\..\..\Prerequisites\CEcho\cecho.exe" red "\nCopy failed: Operation faild with error code %ERRORLEVEL%!\n"
|
|
|
|
pause && exit
|
|
|
|
)
|
2020-04-10 13:32:42 +02:00
|
|
|
|
|
|
|
if exist "%CP_DST%\*" (
|
|
|
|
fc /B "%CP_SRC%" "%CP_DST%\%~nx1"
|
|
|
|
) else (
|
|
|
|
fc /B "%CP_SRC%" "%CP_DST%"
|
|
|
|
)
|
|
|
|
|
|
|
|
if not "%ERRORLEVEL%" == "0" (
|
|
|
|
"%~dp0\..\..\..\Prerequisites\CEcho\cecho.exe" red "\nCopy failed: File content does not match!\n"
|
|
|
|
pause && exit
|
|
|
|
)
|