Host does not exist

Advertisement

ebonnett
Joined:
Posts:
4

Host does not exist

Hi all,

I realize that there are other posts about this but I don't know if they are the same issues. It seems that one or two are.

I have come up with a very simple test harness in C# to transfer some files but I cannot get a connection. Now, when I run the following .bat file by double clicking, it works fine:

"c:\Program Files\WinSCP\WinSCP.exe" /console /script=GetSyncFilesPRERelease.txt

WHERE GetSyncFilesPRERelease.txt is as follows:

lcd C:\FTPTest
option batch on
option confirm off
option transfer binary

open ftp://<username>:<password>@<ipaddress>

get <file_list> <local_dest>

exit

However, when I run it in the following test harness, I get the "Host does not exist".

using System;
using System.Diagnostics;

namespace FTPTest
{
class Program
{
static void Main(string[] args)
{
Process p;
ProcessStartInfo psi = new ProcessStartInfo(@"C:\FTPTest\GetSyncFilesPRERelease.bat");
psi.UseShellExecute = false;
p = Process.Start(psi);
p.WaitForExit();
Console.Read();
}
}
}

Is this a known issue? Is there a work-around? I'm sure I don't need to say this but... I'm in a hurry now that I have spent some time looking into this.

Thanks a million for any help you can offer...

Evan

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Host does not exist

Try to enable logging from the script to see if there are any difference. Also in what environment do you run your C# program? Also have you tried to disable firewall?

Reply with quote

Guest

Re: Host does not exist

martin wrote:

Try to enable logging from the script to see if there are any difference. Also in what environment do you run your C# program? Also have you tried to disable firewall?

I am running this c# app on a Vista box. I did try disabling the firewall (after creating a rule for WinSCP, of course).

I found out what is happening by looking at the log. WinSCP is looking at the /script in the bat file as the host. Therefore, it's looking up a host called script instead of running a script. So if the bat file looks like this:

"c:\Program Files\WinSCP\WinSCP.exe" /console /script=GetSyncFilesPRERelease.txt

the log seems to indicate that it is looking at the /script as the host name. Please advise asap.

Here is the log:

. 2008-10-03 09:24:02.985 --------------------------------------------------------------------------
. 2008-10-03 09:24:02.985 WinSCP Version 4.1.7 (Build 413) (OS 6.0.6001 Service Pack 1)
. 2008-10-03 09:24:02.985 Login time: Friday, October 03, 2008 9:24:02 AM
. 2008-10-03 09:24:02.985 --------------------------------------------------------------------------
. 2008-10-03 09:24:02.985 Session name: script
. 2008-10-03 09:24:02.985 Host name: script (Port: 22)
. 2008-10-03 09:24:02.985 User name: (Password: No, Key file: No)
. 2008-10-03 09:24:02.985 Tunnel: No
. 2008-10-03 09:24:02.985 Transfer Protocol: SFTP (SCP)
. 2008-10-03 09:24:02.985 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2008-10-03 09:24:02.985 Proxy: none
. 2008-10-03 09:24:02.985 SSH protocol version: 2; Compression: No
. 2008-10-03 09:24:02.985 Bypass authentication: No
. 2008-10-03 09:24:02.985 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2008-10-03 09:24:02.985 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2008-10-03 09:24:02.985 SSH Bugs: -,-,-,-,-,-,-,-
. 2008-10-03 09:24:02.985 SFTP Bugs: -,-
. 2008-10-03 09:24:02.985 Return code variable: Autodetect; Lookup user groups: Yes
. 2008-10-03 09:24:02.985 Shell: default, EOL: 0
. 2008-10-03 09:24:02.985 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2008-10-03 09:24:02.985 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2008-10-03 09:24:02.985 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2008-10-03 09:24:02.985 Cache directory changes: Yes, Permanent: Yes
. 2008-10-03 09:24:02.985 DST mode: 1
. 2008-10-03 09:24:02.985 --------------------------------------------------------------------------
. 2008-10-03 09:24:02.985 Looking up host "script"

Reply with quote

Advertisement

jpknz
Joined:
Posts:
1

Any ideas on what is causing this and how to fix/get around it?
Obviously the quoting of the script path with spaces does not work from VB. Do not know why. WinSCP is able to handle that correctly otherwise.

Reply with quote

Advertisement

You can post new topics in this forum