How to exclude a subfolder from an FTP upload when using WinSCP in a batch file

Viewed 681

I create a batch file to upload the file from my local server to the remote server using WinSCP

Here is my code.

@echo off

"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="C:\log\WinSCP.log" /ini=nul ^
  /command ^
    "open s3://USername:PAssword@s3.amazonaws.com/" ^
    "lcd E:\Backups" ^
    "cd /backup/Backup/Config" ^
    "put LiveMainTrade" ^
    "exit"

set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)

exit /b %WINSCP_RESULT%

Under the LiveMainTrade Folder, I have A, B, and C three folders. I want to exclude the folder A, and only upload the folders B and C.

Thank you

1 Answers
Related