Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

MannyD

Issues Passing a Second Command within a BAT file

I have created a script that connects to a SFTP location in order for me to transfer a specific set of files to said location. When I run the file, it looks like it connects but does not perform the action of synchronizing the files. If I run the file and it connects to a Terminal Window, I can paste the command inside of the window and it succeeds. But I need it to do it from inside of the BAT file without manual intervention. Below is my current code.
winscp.com /command "open sftp://example@sftp.bldr.com/ -privatekey="C:\Users\rewing\AppData\Local\Programs\WinSCP\PrivateKey.ppk"

synchronize remote C:\temp\DART_FTP /opt/ftp/DART/Ponderosa/In
cmd /k
exit"