Want to upload multiple files using SFTP to remote server
Worked like a charm; Thank you.
put V:\*.csv /XYZ/WVW_to_User/*_%TIMESTAMP#DD_MM_YYYY% -nopreservetime
-nopreservetime
(example file name: XYZ_10_14_2016.csv)
put V:\*.csv
and lcd V:\
+ put *.csv
.
put V:\*.csv /XYZ/WVW_to_User/ -nopreservetime
-nopermissions
is the default)
# Connect to SFTP server using a password
open sftp://username:password;fingerprint=ssh-**s-**-**-**-**-**-**-**-**-**-**-**-**-**-**-**-**@sftp.**.com/XYZ/WVW_to_User/
# Upload file
lcd V:\
put *.csv /XYZ/WVW_to_User/ -nopreservetime -nopermissions
EXIT
I think you can try doing an LCD to change the directory then try the transfer.
# Connect to SFTP server using a password
open sftp://username:password;fingerprint=ssh-**s-**-**-**-**-**-**-**-**-**-**-**-**-**-**-**-**@sftp.**.com/XYZ/WVW_to_User/
# Upload file
lcd V:\
put *.csv /XYZ/WVW_to_User/
EXIT
"C:\Program Files (x86)\WinSCP\WinSCP.exe" /log= V:\BatchScripts\File_Put.log /script=V:\BatchScripts\File_Put.txt
# Connect to SFTP server using a password
open sftp://username:password;fingerprint=ssh-**s-**-**-**-**-**-**-**-**-**-**-**-**-**-**-**-**@sftp.**.com/XYZ/WVW_to_User/
# Upload file
put V:\*.csv /XYZ/WVW_to_User/
exit