Topic "Script doesn't run when logged out?"

Author Message
garfonzo
[View user's profile]

Joined: 2011-02-21
Posts: 3
Hey folks:

I have a WinSCP script written which logs into a remote server with SSH keys and performs a sync of a directory. The script works perfectly if I double click the "bat" file which in turn calls the script. However, if I set it up as a scheduled task, it simply does not run. I have another scheduled task that does run (this task simply copies a bunch of directories to a local external hard drive).

I am a bit confused as to why it won't run as a scheduled task when I'm logged out given that I have an almost identical task that does run when I'm logged out?

Thanks!
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Have you checked this FAQ?
https://winscp.net/eng/docs/faq_scheduler
Archy

Guest


Hi,

I am encountering the same issue. The task is added to task scheduler and runs well when logged on into Windows XP SP3 (in domain environment). However, it won't run when logged off. Plus, when I logged back in as the system account/local administrator (also creator of the task), I found winscpportable.exe is running in the task manager.

Can you help? I have referred to the FAQ but still not working. My script has the hostkey as suggested, and the stored sessions are in placed/tested, but I am not sure what you meant by the following:

"Environment variables referenced in script are not resolved, because they are not set by the services account." Are you referring to folder permission?
Guest




Instead of using winscp.exe (GUI), I use winscp.com /script bla bla with task scheduler. Worked like a charm.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Archy wrote:
Can you help? I have referred to the FAQ but still not working. My script has the hostkey as suggested, and the stored sessions are in placed/tested,

What does it mean "in place"?

Quote:
"Environment variables referenced in script are not resolved, because they are not set by the services account." Are you referring to folder permission?

No.
_________________
Martin Prikryl
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