"WinSCP.com: open "session name" - Host does not exist.

Advertisement

Sessl
Joined:
Posts:
3

"WinSCP.com: open "session name" - Host does not exist.

Hello,

After a server migration and using the latest WinSCP version 5.19.5, I have the problem, that the parameter open can't be used with a "session name" that previously was entered in WinSCP GUI.

If I start WinSCP.com in CMD and use open A-B-C (A-B-C = session name) WinSCP opens the session.
If I start WinSCP.com via batch script which calls the WinSCP script /script=d:\full\path\abc_trans.txt with open A-B-C issues "Searching for host..." and "Host A-B-C does not exist."

Using open ftp://user:<password>@10.10.10.10/ script is working with WinSCP.com.

"C:\Program Files (x86)\WinSCP\WinSCP.com" /script=D:\full\path\abc_trans.txt /log=D:\full\path\abc_tran.log
# Automatically answer all prompts negatively not to stall the script on errors
option batch on
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect using a password
open A-B-C
# Force ascii mode transfer
option transfer ascii
# Upload file to the remote directory
put D:\files\* /
# Disconnect
close
# Exit WinSCP
exit
Log:
. 2021-12-08 05:25:39.435 Script: Retrospectively logging previous script records:
> 2021-12-08 05:25:39.435 Script: option batch on
< 2021-12-08 05:25:39.435 Script: batch           on        
> 2021-12-08 05:25:39.435 Script: option confirm off
< 2021-12-08 05:25:39.435 Script: confirm         off       
> 2021-12-08 05:25:39.435 Script: open A-B-C
. 2021-12-08 05:25:39.435 --------------------------------------------------------------------------
. 2021-12-08 05:25:39.435 Session name: A-B-C (Ad-Hoc site)
. 2021-12-08 05:25:39.435 Host name: A-B-C (Port: 22)
. 2021-12-08 05:25:39.435 User name:  (Password: No, Key file: No, Passphrase: No)
. 2021-12-08 05:25:39.435 Tunnel: No
. 2021-12-08 05:25:39.435 Transfer Protocol: SFTP (SCP)
Latest working log: (WinSCP 5.5.3)
. 2021-11-26 05:26:01.114 Script: Retrospectively logging previous script records:
> 2021-11-26 05:26:01.114 Script: option batch on
< 2021-11-26 05:26:01.114 Script: batch           on        
> 2021-11-26 05:26:01.114 Script: option confirm off
< 2021-11-26 05:26:01.114 Script: confirm         off       
> 2021-11-26 05:26:01.114 Script: open A-B-C
. 2021-11-26 05:26:01.114 --------------------------------------------------------------------------
. 2021-11-26 05:26:01.114 Session name: A-B-C (Site)
. 2021-11-26 05:26:01.114 Host name: 10.10.10.10 (Port: 21)
. 2021-11-26 05:26:01.114 User name: user (Password: Yes, Key file: No)
. 2021-11-26 05:26:01.114 Tunnel: No
. 2021-11-26 05:26:01.114 Transfer Protocol: FTP
Any ideas?

Thanks in advance and best regards,
Tobias

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
37,591
Location:
Prague, Czechia

Re: "WinSCP.com: open "session name" - Host does not exist.

What is your configuration storage? Registry? Did you save the site using the same local Windows account that runs your script? Are you running both version of WinSCP on the same machine?
Please attach complete logs from both versions. A log file of a successful connection in GUI might help too.

Btw, we do not recommend relying on GUI configuration in scripting.
https://winscp.net/eng/docs/scripting#configuration

Reply with quote

Advertisement

You can post new topics in this forum