To count number of files in SFTP server

Advertisement

anchitjain26@gmail.com
Joined:
Posts:
1
Location:
Gurgaon

To count number of files in SFTP server

Dear Experts,

I am using the below code to download the file present on SFTP server path. I have to add a condition that if only 1 file is present than only it will download & in case more than 1 file is present then it should throw an error message. Any pointer on it?

::1 Download file from SFTP server to Local machine
ECHO Started downloading the files from ERP Cloud SFTP Server %date% %time% >> %logfile%
%WINSCP_EXE_PATH% /command ^
"option batch continue " ^
"option confirm off " ^
"open sftp://%INBOUND_SFTP_CONN%/ "^
"get %INBOUND_SFTP_PATH%*.txt " ^
"close " ^
"exit"

Regards,
Anchit

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum