Help with Windows Server 2008 Scheduled Task

Advertisement

wongnation
Joined:
Posts:
2

Help with Windows Server 2008 Scheduled Task

OK, I'm probably missing something obvious, but I am having difficulty getting a Windows 2008 Server Scheduled Task to execute WinScp.com correctly.

The task is configured to run with the highest privileges and as a specific user account. The command runs fine when I log in as that user account and run the task manually. (The user account is also a domain admin). I have also selected the "Run whether user is logged in or not" option. The "Start in (optional)" field is also set to the WinScp directory (C:\Program Files (x86)\WinSCP).

However, when I select "Run" to trigger the scheduled task to execute, it seems to run indefinitely.

From viewing the Task Manager, I can see the winscp.com and winscp.exe processes start up, but they never end (until I manually end the task or kill the processes).

For sanity's sake, I tried modifying the scheduled task to something simple:
winscp.com /log=foo.log /command "exit"

where the arguments are specified in the "Add arguments (optional)" dialog and even this seems to hang when run as a scheduled task. But this runs fine when I execute it from the Windows command line.

One thing is that the Windows Task Scheduler service is configured to run as the Local System, but I assumed that the specified user account would override that. Also, no log file is generated, but since I am not even connecting to a host, that's somewhat expected.

Again, I apologize in advance if I've missed something obvious, but was wondering if anyone else had run into this. I am running v5.1.4.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,468
Location:
Prague, Czechia

Re: Help with Windows Server 2008 Scheduled Task

Thanks for your report.

The above command should definitely never hang.

I have sent you an email with a debug version of WinSCP to address you have used to register on this forum.

Reply with quote

Difranev
Guest

Exactly the same issue with winscp via scheduled task

Hi,

what was wrong? did you find anything? I have exactly the same issue and it's driving me nuts.
Working correctly when i launch the script manually but winscp.exe and winscp.com are hanging in the task manager and do nothing when launch by scheduled task

Please help :'((

Eve.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,468
Location:
Prague, Czechia

Re: Exactly the same issue with winscp via scheduled task

Difranev wrote:

what was wrong? did you find anything? I have exactly the same issue and it's driving me nuts.
Working correctly when i launch the script manually but winscp.exe and winscp.com are hanging in the task manager and do nothing when launch by scheduled task
Did you read FAQ?
https://winscp.net/eng/docs/faq_scheduler

Reply with quote

Advertisement

trefrog
Guest

fixed this for myself

My problem was that WinSCP.exe wasn't exiting when I ended the task via the Task Scheduler, so my first two test runs were actually still running in the background, and downloading humungous things that I was trying to exclude...

provided that your ini settings, script, and task options are all in order... as per the FAQ.

all I had to do was use WinSCP.com instead of ".exe /console". That's it. That change alone fixed the problem!

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,468
Location:
Prague, Czechia

Re: fixed this for myself

trefrog wrote:

My problem was that WinSCP.exe wasn't exiting when I ended the task via the Task Scheduler, so my first two test runs were actually still running in the background, and downloading humungous things that I was trying to exclude...
Do you mean that you ended winscp.com process and a winscp.exe process was not terminated along? That should not be happening, unless you use some ancient version of WinSCP (4.1.3 or older) or Windows (2000 or older).
See https://winscp.net/tracker/246

Reply with quote

Advertisement

You can post new topics in this forum