Upload file from perticular local Directory

Advertisement

Nizar
Joined:
Posts:
3

Upload file from perticular local Directory

Hi Team,

I am new to WinSCP. I use following script and it works fine to upload test.txt file exists in "winscp554" directory. I want to upload file from local directory "D:\FTP\Upload" instead of "C:\winscp554". Would you please guide me in proper direction?

I am using WinSCP product version 5.5.4.0. Please let me know if you require more info. Thanks in Advance.

C:\winscp554>WinSCP.com /script=FTP_Upload.txt

--------------- FTP_Upload.txt -----------
option batch abort
option confirm off
open sftp://user:password@example.com/
put test.txt
exit
------------------------------------------

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Upload file from perticular local Directory

Just use a full path to the file:

put D:\FTP\Upload\test.txt

Or change local working directory to D:\FTP\Upload. Either before starting WinSCP or from WinSCP script using lcd D:\FTP\Upload.

Reply with quote

Nizar
Joined:
Posts:
3

Re: Upload file from perticular local Directory

Thanks Martin. I use "lcd D:\FTP\Upload" and it works fine.

But when I change it to the folder name with space it provides error message Too many parameters for command 'lcd'. For example, it provides error message for "lcd D:\MY FTP\Upload". Is there anyway, I can include folder/directory with space?

For you information, I am using WinSCP Portable application (v5.5.4.0).

Reply with quote

martin
Site Admin
martin avatar

Re: Upload file from perticular local Directory

You need to wrap any path with spaces to double quotes (it does not harm to wrap any path to double quotes).

I.e. lcd "D:\MY FTP\Upload"

Reply with quote

Advertisement

You can post new topics in this forum