Re: winscp3.com /console /script=f sftp://user1@server:1233
I'm having exactly the same problem.
Thanks to Prikryl's single comment of 'Use winscp3.com' I have gotten it working..
Here's the steps that I took (leaving out the stuff that didn't work of course! :D )
- Ran WinSCP's Gui.
- Set up a saved session..
- Logged on and accepted the certificate
- Closed the session.
- Created a batch file with this line:
"C:\program files\WinSCP\WinSCP.com" algo /privatekey=C:\pathto\USE_THIS_PRIVATE_KEY.ppk /console /script=c:\pathto\today_script.txt /log=c:\pathto\daily_log.txt
- Created the 'today_script.txt' as below
- Done.. works perfectly!
Here's my today_script.txt file:
option batch on
option confirm off
open sftp://sftpuser@servername.com:22 /privatekey=C:\pathto\USE_THIS_PRIVATE_KEY.ppk
cd /ftp/OUT/
get somefile.csv C:\pathto\downloaded\
close
exit
THere may be extra stuff in there (like I probably only need to specify the private key once - if at all - I mean it's saved with the "algo" session..
Either way, awesome stuff!
--KTFA