Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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)


Topic review


Re: " 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.

" open "session name" - Host does not exist.


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 in CMD and use open A-B-C (A-B-C = session name) WinSCP opens the session.
If I start 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>@ script is working with

"C:\Program Files (x86)\WinSCP\" /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
# Exit WinSCP

. 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: (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,