Topic "CMD Script to Upload file - put is ignored"

Author Message
[View user's profile]

Joined: 2016-04-15
Posts: 1
I trying to upload a file in one script line so I can easily change the file name when I generate the Shell command. I can connect to the SFTP server ok, but the put seems to be ignored. there also it does not like the key word open so I removed it and it works better.

This will login but not transfer the file (see attached log file):
"C:\Program Files (x86)\WinSCP\winscp.exe" /command /log="\\ccm-fs-01\sharedusers\SEI Export\FTP Setup\wscpresults.log" "" "put c:\TestAwayTradeBlotter041516.csv " "exit"

this one will not login and tries to set the user to "open john":
"C:\Program Files (x86)\WinSCP\winscp.exe" /command /log="\\ccm-fs-01\sharedusers\SEI Export\FTP Setup\wscpresults.log" " open" "put c:\TestAwayTradeBlotter041516.csv " "exit"

what is the correct syntax to upload a file?
ps. I changed the site to xxxx and my password to password in the sample.
Thank you
sample login works put ignored.log (6.61 KB) Private file

Description: (none)

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
The /log switch is misplaced. It interrupts the command list. Put it before the /command or to the very end. And put the open back.

"C:\Program Files (x86)\WinSCP\winscp.exe" /log="\\ccm-fs-01\sharedusers\SEI Export\FTP Setup\wscpresults.log" /command "open" "put c:\TestAwayTradeBlotter041516.csv" "exit"

You can post new topics in this forum

Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License