Topic "Host does not exist"

Author Message



I am trying to use SFTP to transfer a file from within VB.NET. I've set up a session and can connect to the server when using the Commander interface. Here's my code in VB.NET
' Run hidden WinSCP process
Dim winscp As Process = New Process()
winscp.StartInfo.FileName = gstrFTPProcessLocation 'Location of (usually C:\Program Files\WinSCP\
winscp.StartInfo.Arguments = "/log=" + LogName
winscp.StartInfo.UseShellExecute = False
winscp.StartInfo.RedirectStandardInput = True
'winscp.StartInfo.RedirectStandardOutput = True
winscp.StartInfo.CreateNoWindow = True

' Feed in the scripting commands
winscp.StandardInput.WriteLine("option batch abort")
winscp.StandardInput.WriteLine("option confirm off")
winscp.StandardInput.WriteLine("open " & gstrFTPSession) 'This is a session you must setup in WinSCP
winscp.StandardInput.WriteLine("put " & strOutFile)

' Collect all output (not used in this example)
'Dim output As String = winscp.StandardOutput.ReadToEnd()

' Wait until WinSCP finishes

I get an exit code of 1 and do not get a log file. This code had been working, but I'm connecting to a new FTP site and it's bombing. If I comment out CreateNoWindow, I see the error message is "Host does not exist".

When I use the console ( directly from a command line, I get "Host does not exist" as well. I can connect to other stored sessions just fine thru the console. Just this one site it isn't happy with. And when I use commander, it connects to my stored session just fine.

Any help greatly appreciated.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24759
Location: Prague, Czechia
Are you able to get log if you run WinSCP manually and type the open command in console?
Martin Prikryl

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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License