@ECHO OFF REM Configuration Navision SET IP_Enterprise=IP_Navision SET location_Enterprise_out=\\%IP_Enterprise%\EXDC\OUT\ SET location_Enterprise_out_backup=\\%IP_Enterprise%\EXDC\OUT\BU SET file_extension_Enterprise_XML=XML SET file_extension_Enterprise_XML_temp=RBP SET file_extension_Enterprise_ZIP=ZIP SET file_extension_Enterprise_ZIP_temp=BHJ REM Configuration StoreCenter SET IP_StoreCenter=IP_StoreCenter SET location_StoreCenter_in=\\%IP_StoreCenter%\EXDC\IN\ REM Logging SET indication_logging=1 SET indication_logfile_append=0 SET file_log="%location_Enterprise_out%ExportXML2OSC.log" REM Option (if no write-privilege on share) REM SET file_log=C:\EXDC\OUT\ExportXML2OSC.log :LOG IF NOT %indication_logging%==1 GOTO XML IF NOT %indication_logfile_append%==1 DEL %file_log% ECHO Date: >> %file_log% DATE /T >> %file_log% ECHO Time: >> %file_log% TIME /T >> %file_log% ECHO -------------------------------------------------- >> %file_log% PING %IP_Enterprise% >> %file_log% PING %IP_StoreCenter% >> %file_log% ECHO -------------------------------------------------- >> %file_log% ECHO XML-files: >> %file_log% DIR "%location_Enterprise_out%*.%file_extension_Enterprise_XML%" >> %file_log% ECHO -------------------------------------------------- >> %file_log% ECHO ZIP-files: >> %file_log% DIR "%location_Enterprise_out%*.%file_extension_Enterprise_ZIP%" >> %file_log% :XML IF %indication_logging%==1 ECHO -------------------------------------------------- >> %file_log% && ECHO Start export XML: >> %file_log% FOR %%i in ("%location_Enterprise_out%*.%file_extension_Enterprise_XML%") DO CALL :FILE_TRANSFER "%%i" %file_extension_Enterprise_XML% %file_extension_Enterprise_XML_temp% :XML_END :ZIP IF %indication_logging%==1 ECHO -------------------------------------------------- >> %file_log% && ECHO Start export ZIP: >> %file_log% FOR %%i in ("%location_Enterprise_out%*.%file_extension_Enterprise_ZIP%") DO CALL :FILE_TRANSFER "%%i" %file_extension_Enterprise_ZIP% %file_extension_Enterprise_ZIP_temp% :ZIP_END GOTO FINISH :FILE_TRANSFER SET file_in=%1 SET file_out=%~n1% SET file_out_rename=%file_out%.%2 SET file_out="%location_StoreCenter_in%%~n1%" SET file_out=%file_out%.%3 IF %indication_logging%==1 ECHO ---------- >> %file_log% && ECHO COPY %file_in% %file_out% >> %file_log% COPY %file_in% %file_out% >> %file_log% IF EXIST %file_out% ( IF %indication_logging%==1 ECHO MOVE %file_in% "%location_Enterprise_out_backup%" >> %file_log% MOVE %file_in% "%location_Enterprise_out_backup%" >> %file_log% IF %indication_logging%==1 ECHO REN %file_out% %file_out_rename% >> %file_log% REN %file_out% %file_out_rename% >> %file_log% ) ELSE ( IF %indication_logging%==1 ECHO No action >> %file_log% ) GOTO :EOF :FINISH