Problem downloading files from SFTP site with batch job
I am trying to download files from a SFTP site using a batch file. While it seems to be connecting to the SFTP site I get the following error:
My batch file looks like the below:
ARS is the folder name of the SFTP site, and D:\Import\ is the folder name where I want to have my files downloaded. My files start with the name ARS_LAST_MT and have a timestamp to it. That's why I want to use a wildcard.
What am I doing wrongly here? I would be very thankful for any support.
Unknown command '^'. The system cannot find the path specified. '"exit"' is not recognized as an internal or external command, operable program or batch file.
@echo off "D:\Utilities\WinSCP\WinSCP.com" ^ /command ^ "open sftp://XXXXXXXXXXX/ -hostkey=""ssh-dss 1024 XXXXXXXXXXXXXXXXXXXXXX"" -privatekey=""D:\XXXXXXXXXXXXXXXXX"" -rawsettings ProxyMethod=2 ProxyHost=""XXXXXXXXXXXXX"" ProxyPort=XXXXXXXX" ^ "lcd D:\Import\" "cd /ARS" ^ "get -delete ARS_LAST_MT* D:\Import\" "exit"
ARS is the folder name of the SFTP site, and D:\Import\ is the folder name where I want to have my files downloaded. My files start with the name ARS_LAST_MT and have a timestamp to it. That's why I want to use a wildcard.
What am I doing wrongly here? I would be very thankful for any support.