@echooff
echo[%date% - %time%] Logstart>> C:AGS_BATCHBatch.log
if not exist"G:SAGEM_WQAR"gotoERROR1
if not exist"W:DOWNLOAD"gotoERROR2
dir /b"G:SAGEM_WQAR*" | >nul findstr"^" && (echo[%date% - %time%] Datainthe folderexist,readyforcopying>>
C:AGS_BATCHBatch.log) ||(GOTOERROR3)
REM XCOPYpart
xcopy/S/E/R/Y/I/CG:SAGEM_WQARW:DOWNLOAD
IF %ERRORLEVEL%NEQ 0 GOTO ERROR_HANDLER
REM DELETE All part
del /s/f/qG:SAGEM_WQAR*
for /D %%i in("G:SAGEM_WQAR*") doRD /S/Q "%%i"
echo[%date% - %time%] Copyingsucessful.>>C:AGS_BATCHBatch.log
GOTO QUIT
:ERROR1
echo[%date% - %time%] ERROR1-Source datadoesnnotexistornotavailable.>>C:AGS_BATCHBatch.log
echo[%date% - %time%] Check"G:SAGEM_WQAR"folder.>>C:AGS_BATCHBatch.log
GOTO QUIT
:ERROR2
echo[%date% - %time%] ERROR2-Destinationfolderdoesnnotexistornotavailable.>>C:AGS_BATCHBatch.log
echo[%date% - %time%] Check"W:DOWNLOAD"folder.>>C:AGS_BATCHBatch.log
GOTO QUIT
:ERROR3
echo[%date% - %time%] Nodatafoundinthe Source folder,processaborted>>C:AGS_BATCHBatch.log
GOTO QUIT
:ERROR_HANDLER
echo[%date% - %time%] Erroroccuredduringcopyingof flightdata.>> C:AGS_BATCHBatch.log
echo[%date% - %time%] Please checkyouroriginanddestinationfolders.>>C:AGS_BATCHBatch.log
echo[%date% - %time%] Batchfile returncode:%ERRORLEVEL%>>C:AGS_BATCHBatch.log
GOTO QUIT
:QUIT
echo.>> C:AGS_BATCHBatch.log
exit

Data_moving_script

  • 1.
    @echooff echo[%date% - %time%]Logstart>> C:AGS_BATCHBatch.log if not exist"G:SAGEM_WQAR"gotoERROR1 if not exist"W:DOWNLOAD"gotoERROR2 dir /b"G:SAGEM_WQAR*" | >nul findstr"^" && (echo[%date% - %time%] Datainthe folderexist,readyforcopying>> C:AGS_BATCHBatch.log) ||(GOTOERROR3) REM XCOPYpart xcopy/S/E/R/Y/I/CG:SAGEM_WQARW:DOWNLOAD IF %ERRORLEVEL%NEQ 0 GOTO ERROR_HANDLER REM DELETE All part del /s/f/qG:SAGEM_WQAR* for /D %%i in("G:SAGEM_WQAR*") doRD /S/Q "%%i" echo[%date% - %time%] Copyingsucessful.>>C:AGS_BATCHBatch.log GOTO QUIT :ERROR1 echo[%date% - %time%] ERROR1-Source datadoesnnotexistornotavailable.>>C:AGS_BATCHBatch.log
  • 2.
    echo[%date% - %time%]Check"G:SAGEM_WQAR"folder.>>C:AGS_BATCHBatch.log GOTO QUIT :ERROR2 echo[%date% - %time%] ERROR2-Destinationfolderdoesnnotexistornotavailable.>>C:AGS_BATCHBatch.log echo[%date% - %time%] Check"W:DOWNLOAD"folder.>>C:AGS_BATCHBatch.log GOTO QUIT :ERROR3 echo[%date% - %time%] Nodatafoundinthe Source folder,processaborted>>C:AGS_BATCHBatch.log GOTO QUIT :ERROR_HANDLER echo[%date% - %time%] Erroroccuredduringcopyingof flightdata.>> C:AGS_BATCHBatch.log echo[%date% - %time%] Please checkyouroriginanddestinationfolders.>>C:AGS_BATCHBatch.log echo[%date% - %time%] Batchfile returncode:%ERRORLEVEL%>>C:AGS_BATCHBatch.log GOTO QUIT :QUIT echo.>> C:AGS_BATCHBatch.log exit