Topic "Host does not exist"

Author Message
zvalentiner
[View user's profile]

Joined: 2010-11-12
Posts: 5
When running a script (either from Task Scheduler or by right clicking and opening the script with WinSCP command prompt), I get the error "Host does not exist." However, if I manually enter the commands into the prompt, I am able to connect without any issues.

Start of the script:
Code:

option batch on
option confirm off
open <session>



Resulting error:
Code:

Searching for host...
Host does not exist


I've done a bit of googling, have looked at previous posts on this forum, and have checked the FAQ and this page referenced in other posts, but none of the suggestions seem to be applicable to my case. Windows Task Schedule was able to run this for a few months without any problems, and suddenly started giving this error; I don't know what may have changed. I updated to the most recent version of WinSCP hoping that it might solve the issue, but had no luck.

What might I be able to to do remedy this?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Post a log file both for successful an unsuccessful case.
_________________
Martin Prikryl
zvalentiner
[View user's profile]

Joined: 2010-11-12
Posts: 5
Here are the log results (I picked Debug 2, not sure if Debug 1 or Info is better) from opening the script in the WinSCP command line, and then by copy-pasting the commands from the script into command line.

http://pastebin.com/SBAHWJqd


Obviously "Session Name: D" etc. is not correct - no idea why it's doing that.

Here's the start of the script again:
Code:

option batch on
option confirm off
open <username>@<server> -privatekey="<path to key>"


I've tried reducing the script to just
Code:

open <username>@<server>

in an attempt to remove further complexities, but still get the same result of trying to connect to this host "D" when opening the script with the console interface.



I also created a new script with just the open command, in case the initial script had become corrupted, but had the same result. I also tried connecting to other hosts with the same result. I also tried with the IP of the server instead of the hostname, and oddly enough, also without any "open" command, and got the same error.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Do you see "batch on" "confirm off" lines before the "Searching for host... Host does not exist" lines on the console? If not then the D session is being opened from the command-line, not from the script. Can you post a full command line you use to execute WinSCP?
_________________
Martin Prikryl
zvalentiner
[View user's profile]

Joined: 2010-11-12
Posts: 5
I'm not even issuing a command anymore, but I can get back to you in a bit with the command that I was previously using in Windows Automated Tasks.

Now when trying to run it, I just right-click on the script, and select "open with WinSCP command interface". I don't see the "batch on" and "confirm off" lines before "Searching for host...". Back when I initially wrote the script, I was able to execute the script in this manner.
zvalentiner
[View user's profile]

Joined: 2010-11-12
Posts: 5
Here is what's in my automated task:

Code:

C:\<path to winscp> /console /script=<path to script>


However, as I mentioned, it doesn't work even when I right-click the script and open with WinSCP.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Do you enclose the path to script in double-quotes?

Note the that the running of the script from the right-click menu is not a functionality of the WinSCP. So I cannot know, what is it doing actually.
_________________
Martin Prikryl
zvalentiner
[View user's profile]

Joined: 2010-11-12
Posts: 5
Yes, was using double quotes.

Not sure what ended up fixing it, but the issue was resolved. Thanks for your help!
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