Calling a console application (.exe) file using Task Scheduler is returning the following error "0x41301"

1

I have a console application which uses some SharePoint dll libraries, to execute a background jobs.

Now I can manually run the console application without any problem. but when I schedule its execution using windows 2008 R2 Task Scheduler, I got the following error:

0x41301

Here is how the action looks like:

enter image description here

And I have the following text inside the Add arguments:

-ExecutionPolicy Bypass -File C:\batchfiles\ConsoleApplication1.exe

Can anyone advise why I am getting this error?

John John

Posted 2016-10-24T17:02:45.520

Reputation: 235

10x41301 = SCHED_S_TASK_RUNNING = The task is currently running – magicandre1981 – 2016-10-24T19:25:24.043

@magicandre1981 but it will stay for long time,, while if I manually run the console application it will ends after 20 seconds... – John John – 2016-10-25T01:36:25.000

I have no idea. I only checked the Headers of the SDK to see what the error means – magicandre1981 – 2016-10-25T15:38:02.363

No answers