Topic "Scripting connection fails"

Author Message
PNORMAN
[View user's profile]

Joined: 2013-04-26
Posts: 2
I installed the product today and I'm trying to execute a script connection.

I am able to connect to SFTP using GUI but not by using script.

I created a script below and saved it to the file I:\ProjectMates\Send2PrjMates.txt

Scrip:
# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect using a password
# open sftp://user:password@example.com -hostkey="ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
# Connect
# Specal charaters are entered as hexdecimal an "@" is entered as %40
open sftp://SourcePMDynamics:ShvacDynamics%4013@projectmates.com:222

# Change remote directory
cd /Drop
synchronize remote I:\ProjectMates\Send /Drop
# Disconnect
close
# Exit WinSCP
exit

I execute the scrip by opening a command prompt and pasting the command below:

"C:\Program Files (x86)\WinSCP\WinSCP.com" script=I:\ProjectMates\Send2PrjMates.txt


I get the error "Host does not exist"

My password for the SFTP site is ShvacDynamics@13

The port is:222

I am user WinSCP version 5.14 Build3020

on a Windows 7 Pro workstaion

The protocall is SFTP-4

I am able to syncronize using the GUI. What am I doing wrong with the command interface.

Is is also possible to refernce a UNC path for the script and the synchronize command?
sfpt connection on GUI.pdf (200.69 KB) [Download]

Description: (none)

Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
In GUI you use host name sftp.projectmates.com, while in script you use projectmates.com.
_________________
Martin Prikryl
PNORMAN
[View user's profile]

Joined: 2013-04-26
Posts: 2
prikryl wrote:
In GUI you use host name sftp.projectmates.com, while in script you use projectmates.com.


Thanks for the update. I tried this prior with the same results. To confirm, I changed the script again and re-ran. I get the same error, "Host does not exist"

Below is a copy of the new script I just ran.


# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect using a password
# open sftp://user:password@example.com -hostkey="ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
# Connect
# Specal charaters are entered as hexdecimal an "@" is entered as %40
# open sftp://SourcePMDynamics:ShvacDynamics%4013@projectmates.com:222

open sftp://SourcePMDynamics:ShvacDynamics%4013@sftp.projectmates.com:222

# open sftp://SourcePMDynamics:ShvacDynamics%4013@[209.235.100.69]:222
# open sftp://SourcePMDynamics:ShvacDynamics%4013%40projectmates.com:222
# Change remote directory
cd /Drop
synchronize remote I:\ProjectMates\Send /Drop
# Disconnect
close
# Exit WinSCP
exit
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Please attach a complete session log file both from the script and GUI. Alternatively compare them yourself to find the difference.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License