I am trying to get a scheduled task to run on a schedule on Windows Server 2008 R2 OS and it keeps hanging in the "running" state without ever completing. The task calls a batch file in command prompt to connect to a remote server using psftp.
This batch file runs fine when it is executed manually under the user credentials,but for some reason it never completes when added to a scheduled task.
In the "Last Run Result" field there is a status of (0x41301)
This task has been set up with the following details from each tab:
set up to run with a domain account with local admin permissions on the server
set to run whether or not a user is logged on
Do not store password is not checked
Run with highest privileges is checked
Set to run Monday, Tuesday, Wednesday, Thursday, Friday of each week
Start a program located on the D: drive ( a windows bat file that calls psftp) psftp.exe
file is located in the same directory on the D: drive as the bat file
The fields "Add arguments" and "Start in" are blank
Power - Start the task only if computer is on AC power - checked
Stop if computer switches to battery power - checked
Allow task to be run on demand - checked
Stop the task if it runs for longer than 3 days
If the running task does not end when requested force it to stop - checked
The domain account that the task runs under has full control (is a local admin on server) of the drive and folders containing the exes and bat files so it shouldn't be a permissions issue either. The log for the task only tells me the task commenced but no more information is provided.