Post a reply

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

martin

@shortmort37: The only difference I see is the upgrade to the latest version of WinSCP.
shortmort37

OMG; how embarrassing. A refresh of Task Scheduler shows the task has exited.

Nothing to see here, please move along. I'm all good!

Thanks
Dan
shortmort37

I upgraded to Version 5.21, generated a session/URL Code, and inserted that in my script; doncha know, it works now both interactively in a Windows session, and when scheduled with the Task Scheduler. For what it's worth, the new logs are attached; I'm not sure what I was doing wrong, but generating the code seems to have fixed it.

Just to note: For whatever reason, the task remains in a "running" status after completion in the Task Scheduler. It sounds like a different issue; I'll explore further.
shortmort37

Re: Having trouble porting WinSCP script from Windows 8.1 to Windows 11 Task Scheduler

I'm referring to the generated session code when you export settings – it doesn't include TunnelKey, as you describe in this post. [Edit - and I see that you've added it in 5.20! I'll upgrade to address that particular issue.]

Sorry, I don't have 8.1 logs anymore; but, I do have two Windows 11 logs, one from an interactive Windows session, the other produced when the script is run from the Task Scheduler. I've added as a private attachment.
martin

Re: Having trouble porting WinSCP script from Windows 8.1 to Windows 11 Task Scheduler

@shortmort37: Please post WinSCP session log. Additionally session log of working connection from Windows 8.1 might be useful too, if you still have it available.

I'm not sure I understand, what you mean by ""Tunnel Key" parameter that's not included in the Export Configuration option".
shortmort37

Having trouble porting WinSCP script from Windows 8.1 to Windows 11 Task Scheduler

I'm using WinSCP Version 5.19 (Build 11512). I didn't have to do anything differently (as I recall) with my script on Windows 8.1 – it ran from the command line, or via the Task Scheduler. The former works with Windows 11, but not when scheduled.

I'm using Pageant to store my SSH Keys, and my script does include the "Tunnel Key" parameter that's not included in the Export Configuration option. I surmise that the Pageant key storage isn't exposed to my Task Scheduler session, although I don't know why that wasn't an issue in 8.1. But the script references the file where the private key is stored, so that's an addition source of confusion.

I did review this faq, but I admit to not making much sense of it. I did create an INI file and added that as a parameter on the CL, to no avail. The Task Scheduler log, not finding the pageant key (in about the same spot where the interactive script *does* find it), looks for an SSH password and, not finding it, fails the authentication.

I'm confused. Please help this noobie out of the woods.

Dan
Kryst

Scheduled task not working in Task Scheduler

Hi
I have a script in WinSCP folder on Windows 2008 which does work when navigating to it and executing from a command line CMD.

When creating task - I have used in actions:
Start Program:
C:\Program Files (x86)\WinSCP\file.bat

This doesn't work.
Not sure why?
How can I specify in task scheduler to open CMD automatically and the run bat file ?
Will that be working?

Thanks
Kryst