I am very new to both WinSCP and batch file scripting. So excuse me if this question is very basic. I am trying to upload file from my local folder to remote folder using batch file. The name of the file changes every week. I am facing 2 problems.
- I am using below code in batch file to upload a file to WinSCP
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/command ^
open sftp://descartes:z*******s@sftp.psdataservices.com/ -hostkey="ssh-rsa 1024 ******=" ^
"lcd C:\Users\kajal.jain\Downloads\New folder" ^
"cd /" ^
"put Week 7 2022 Portal Data" ^
"exit"
I am getting below error.
Unknown command 'lcd C:\Users\kajal.jain\Downloads\New folder'.
Same for cd
- As the name of file to be uploaded changes every week. How can I automate it in the Put command?