Good day, all,
I am trying to run a script to connect to an SFTP site, change to a folder on the site and then push files from three different folders on my local machine to the SFTP folder.
I am unable to change to the local folders.
Here is the script:
# End script on error
option batch abort
# No confirmations
option confirm off
# Connect to SFTP server
open sftp://username:password@ftpaddress:port/ -hostkey="ssh-rsa #### xx:xx:xx:xx:xx:..."
# change SFTP directory
cd /FTPfolder
# change local dir
lcd T:\start\one\two
# Upload file(s)
mput two*.*
# change local directory
lcd T:\start\one\three
# Upload file(s)
mput three*.*
# Change local directory
lcd T:\start\one\four
# Upload file(s)
mput four*.*
# Disconnect
close
exit
The script is launched from the T:\start folder
Here is the error:
> 2015-03-27 13:37:17.040 Script: lcd T:\start\one\two
> 2015-03-27 13:37:17.040 Script: Parameter: T:\start\one\two
< 2015-03-27 13:37:17.040 Script: Error changing directory to 'T:T:\start\one\two'.
< 2015-03-27 13:37:17.056 Script: System Error. Code: 2.
< 2015-03-27 13:37:17.056 The system cannot find the file specified
. 2015-03-27 13:37:17.056 Script: Failed
I've tried these commands, all have failed:
lcd T:\start\one\two
lcd T:/start/one/two
lcd .\one\two
lcd ./one/two
lcd \one\two
lcd /one/two
lcd \\fileprint\files\start\one\two
lcd //fileprint/files/start/one/two
If I # (comment) out the lcd commands, and manually place the files into the T:\start folder before running the script, the script completes without an error.
Any suggesions?
Regards,
esm3x