@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% REM 2010-11-17 - ACA-EdB - In geval SC-data op andere server dan op RE-server staat en waarbij user niet dezelfde wachtwoorden op RE- en SC-server heeft REM dan dient onderstaand regel uitgezet te worden (door REM voor de regel te plaatsen). Tevens dient in deel NETUSE ook het wachtwoord gedefinieerd te worden. GOTO LOG2 :NETUSE REM 2010-10-06 - ACA-EdB - Toevoeging als gevolg van niet dezelde wachtwoorden op RE- en SC-server NET USE \\%IP_StoreCenter%\EXDC\IN /DELETE NET USE \\%IP_StoreCenter%\IPC$ /DELETE REM In onderstaand commando is xxx het wachtwoord behorende bij user Administrator - desgewenst aanpassen naar klantsituatie NET USE \\%IP_StoreCenter%\EXDC\IN xxx /user:Administrator IF errorlevel 1 ( ECHO NET USE naar StoreCenter-share niet succesvol >> %file_log% ) ELSE ( ECHO NET USE naar StoreCenter-share succesvol >> %file_log% ) ECHO -------------------------------------------------- >> %file_log% :LOG2 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=%~nx1% 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