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.

Options
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)

Options

Topic review

zvalentiner

Yes, was using double quotes.

Not sure what ended up fixing it, but the issue was resolved. Thanks for your help!
martin

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.
zvalentiner

Here is what's in my automated task:

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.
zvalentiner

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.
martin

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?
zvalentiner

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.

https://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:
option batch on

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


I've tried reducing the script to just
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

Post a log file both for successful an unsuccessful case.
zvalentiner

Host does not exist

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:
option batch on
option confirm off
open <session>

Resulting error:
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?