Saturday, February 12, 2022

Working with Batch Files


Synchronise List of files from Linux Server to Window using Batch file

@echo off
"C:\Users\mmendu\AppData\Local\Programs\WinSCP\WinSCP.com" ^
/ini=nul ^
/command ^
"open sftp://a_MMendu:P "synchronize -filemask=S_EDI_202202*.TXT local C:\Users\mmendu\Documents\UFT /app/retek/rtkstst/transport/extract" ^
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)

Get the files by Masking in synchorize command

synchronize -filemask=RMS_EDI_202202*.TXT local "+FilesFolderpath+" /app/retek/rtkstst/transport/extract"

No comments:

Post a Comment