CMD Script to Upload file - put is ignored

Advertisement

johns1951
Joined:
Posts:
1

CMD Script to Upload file - put is ignored

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" "john:password@mfd.ftp.xxxx.com/" "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 john:password@mfd.ftp.xxxx.com/" "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)

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,453
Location:
Prague, Czechia

Re: CMD Script to Upload file - put is ignored

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 john:password@mfd.ftp.xxxx.com/" "put c:\TestAwayTradeBlotter041516.csv" "exit"

Reply with quote

Advertisement

You can post new topics in this forum