What if you run the command-line manually, instead of in Scheduler?
Are you sure the variable
%Temp_Dir%is visible by the local account that runs the Scheduler task?
In doing further testing with your direction, I found that the variable is not available when the job runs via the scheduler (Z-Cron). It works when run as my user, but not when run as a service. I'll have to dig in and figure out how to make this work.
At this time, it is not WinSCP that is causing the issue.
Thanks for all your help.