Windows task scheduler error 101 launch failure code 2147943785 [closed]
Asked Answered
T

6

84

I'm trying to schedule my C# program to run on Windows scheduler. I'm using, Windows 7 Professional.

I can create the task security options set to run whether or not the user is logged in, gave it high privileges, it is to launch an exe on a remote path which I have access to.

"Error Value: 2147943785" your help would be much appreciated.

Here's the XML for the error

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name="Microsoft-Windows-TaskScheduler" Guid="{DE7B24EA-73C8-4A09-985D-          5BDADCFA9017}" /> 
  <EventID>101</EventID> 
  <Version>0</Version> 
  <Level>2</Level> 
  <Task>101</Task> 
  <Opcode>101</Opcode> 
  <Keywords>0x8000000000000001</Keywords> 
  <TimeCreated SystemTime="2013-01-10T12:44:20.882178000Z" /> 
  <EventRecordID>51522</EventRecordID> 
  <Correlation /> 
  <Execution ProcessID="652" ThreadID="1892" /> 
  <Channel>Microsoft-Windows-TaskScheduler/Operational</Channel> 
  <Computer>pcb.co.za</Computer> 
  <Security UserID="S-1-5-18" /> 
  </System>
- <EventData Name="TaskStartFailedEvent">
  <Data Name="TaskName">\Naedo</Data> 
  <Data Name="UserContext">Domanin\User31r</Data> 
  <Data Name="ResultCode">2147943785</Data> 
  </EventData>
  </Event>
Tensiometer answered 10/1, 2013 at 13:41 Comment(0)
F
121

The user that is configured to run this scheduled task must have "Log on as a batch job" rights on the computer that hosts the exe you are launching. This can be configured on the local security policy of the computer that hosts the exe. You can change the policy (on the server hosting the exe) under

Administrative Tools -> Local Security Policy -> Local Policies -> User Rights Assignment -> Log On As Batch Job

Add your user to this list (you could also make the user account a local admin on the machine hosting the exe).

Finally, you could also simply copy your exe from the network location to your local computer and run it from there instead.

Note also that a domain policy could be restricting "Log on as a batch job" rights at your organization.

Frozen answered 10/1, 2013 at 13:50 Comment(8)
thanks Jesse, I get to the log on as batch screen but the buttons "Add user or group" and "Remove" are inactive, is there a way to get around that?Tensiometer
It sounds like you are not signing into that computer as a local administrator. Only a local administrator can make changes to who is in the "Log on as batch" group.Frozen
Thank you very much Jesse the exe. was on a remote machine so I just copied it to my local machine and it worked, much appreciated :)Tensiometer
It could also caused by having surrounding quotes on the “Start In” path. Remove the quotes! See here: jorink.nl/2013/06/…Tocantins
@erroric: the referenced article talking about different Error Value: 2147942667Bobcat
For fixing domain policy if you have access, see this SO answer "...Basically on your DC, Administrative Tools->Group Policy Management->Computer Configuration->Policies->Windows Setting->Security Settings->Local Policies->User Rights Assignment->Log on as a batch job, edit and add your user there."Emmalynn
I experienced this issue while using a service account intended for the IIS Application Pools. Adding the service account to the group IIS_IUSRS accomplished the same result.Gyrfalcon
What's strange is this should not be an issue, especially when running from an Administrator account. From the GPO explanation "...and is provided only for compatibility with older versions of Windows...Default: Administrators...". The account I was using is a Domain Admin and the task's compatibility is set for Server 2019, yet adding the user to the GPO allowed it to run.Blubberhead
C
23

Had the same issue but mine was working for weeks before this. Realised I had changed my password on the server.

Remember to update your password if you've got the option selected 'Run whether user is logged on or not'

Carper answered 11/4, 2018 at 8:40 Comment(1)
Just to add a bit of clarification, in order to change the password on the task all you have to do is open the properties dialog and press the OK button. If your password has changed since you created the task, it will prompt you for it.Chaw
D
5

Just adding this for anyone with the same problem as me, I was getting the "Task Start Failed" error because I had changed my Windows password so I had to open the task properties and save with the new password.

Donahue answered 7/5, 2021 at 8:17 Comment(0)
K
2

I have the same today on Win7.x64, this solve it.

Right Click MyComputer > Manage > Local Users and Groups > Groups > Administrators double click > your name should be there, if not press add...

Kid answered 9/12, 2016 at 18:49 Comment(0)
M
2

Had the same issue today. I added the user to:

Administrative Tools -> Local Security Policy -> Local Policies -> User Rights Assignment -> Log on as a batch job

But was still getting the error. I found this post, and it turns out there's also this setting that I had to remove the user from (not sure how it got in there):

Administrative Tools -> Local Security Policy -> Local Policies -> User Rights Assignment -> Deny log on as a batch job

So just be aware that you may need to check both policies for the user.

Meliorism answered 11/6, 2020 at 19:24 Comment(2)
Maybe you didn't read the entire answer @Shaun? It calls out a 2nd policy to check, which could be preventing the 1st policy (i.e. the recommended answer to the question) from taking effect. Maybe you didn't have to modify the 2nd policy in your specific case, but I did, and thought it was worth sharing.Meliorism
Apologies, I did read this post but thought it was already past of the other post, I can't retract the down vote without an edit however.Hassanhassell
C
2

I have changed the method of execution of the task and now it performs it without problems

Changed Method

Celibacy answered 4/8, 2021 at 8:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.