@echo off
setlocal

REM === Pfade & Parameter anpassen ===
set WINSCP="C:\ISGUS\SAPInterface\WinSCP_SFTP\winscp.com"

set SFTP_SERVER=XXX.XXX.XXX.XXX
set SFTP_PORT=22
set SFTP_USERNAME=XXXXXXXXXXXXXX
set SFTP_PASSWORD=XXXXXXXXXXXXXX

set IMPORT_REMOTE_FILE=/senden/XXXXXX Zeitwirtschaftsdaten/absence_from_sap_sf.txt
set IMPORT_LOCAL_FILE=C:\ISGUS\SAPInterface\absence_zeusx_IMPORT.txt

set EXPORT_REMOTE_FILE=/senden/XXXXXX Zeitwirtschaftsdaten/timedata_to_sap_sf.txt
set EXPORT_LOCAL_FILE=C:\ISGUS\SAPInterface\time_zeusx_EXPORT.txt


REM === WinSCP inline commands ===
%WINSCP% ^
  /command ^
  "open sftp://%SFTP_USERNAME%:%SFTP_PASSWORD%@%SFTP_SERVER%:%SFTP_PORT%" ^
  "get ""%IMPORT_REMOTE_FILE%"" ""%IMPORT_LOCAL_FILE%""" ^
  "exit"

%WINSCP% ^
  /command ^
  "open sftp://%SFTP_USERNAME%:%SFTP_PASSWORD%@%SFTP_SERVER%:%SFTP_PORT%" ^
  "put ""%EXPORT_LOCAL_FILE%"" ""%EXPORT_REMOTE_FILE%""" ^
  "exit"


REM pause
