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.