Share via

Getting exit code 2147943591 on shutdown task

Anonymous
2024-09-06T11:43:46+00:00

I have set up a task in task scheduler to shutdown and reboot my computer at set time each night. The task settings include:

1-use account jwcec which is only account on PC. Also checked is Run whether Users is logged on or not and with Highest Privileges.

2-trigger is time of day, every day.

3- sets the action to Start Program c:\wiindows\system32\shutdown.exe with a parameter of /g.

4-Wake the computer to run task is checked.

I can execute the command from a command prompt or if I 'Run' the Task from the Task Scheduler. However, with the task scheduled, it initiates the task, but the Action Completed returns "Task Scheduler successfully completed task "\JC-TaskShutdown" , instance "{2a0206fb-d85c-4216-ae08-449226791477}" , action "C:\Windows\System32\shutdown.exe" with return code 2147943591." Looking up this code and found that it means "The system shutdown cannot be initiated because there are other users logged on to the computer."

The problem occurs on the scheduled task, whether the computer is awake and screens are all up, or if the

Other than settings above, I have tried changing other settings based on web searches but nothing has worked to actually complete task as scheduled.

...I considered it might be the Norton Anti-Virus, but then it shouldn't work when I Run the task manually. I have also set the power settings "Dell" to put computer to sleep:Never.

Any suggests or idea why it returns a code regarding another user when jwcec is the only user?

Windows for home | Windows 11 | Performance and system failures

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2024-09-07T17:26:39+00:00

    Congratulations John you fixed the issue. Good on ya! Bravo John :)

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2024-09-07T14:21:10+00:00

    thanks for the suggestion but making those changes didn't change the behavior.

    However, I did try stopping Norton Antivirus and MalwareBytes, as well as disconnecting from the internet.

    I then created a new Task...with the same settings as before the best I can recall...and the Task succeeded shutting down and restarting.

    I then ran the Task on schedule, with antivirus/malwarebytes running, and it worked.

    Lastly, I reconnected network cable and ran the task on schedule and it still worked.

    So, bottom line, it is now working but I have no idea why!

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2024-09-06T13:30:42+00:00

    Hi John,

    This is Mote an indipendent advisor just seeing if I can help with this case

    Firstly could you try running the task with as you currently have it setup but switch the "Configure For" at the bottom of the task to Windows Vista, Windows 7 or Windows 10 or whatever other options you have and try them individually? to see if one of them works with your current setup?

    Failing that could you try setting and running your task with "only when the user is logged on"? if it can run successfully that way then there is a high likelihood that the account you've got needs the "Log on as a batch job" permission to run the task when you're not logged in.

    If you want to run the batch job when you're not logged in, you need a special privilege called "Log on as a batch job". Note that there is also a "DENY log on as a batch job" privilege, which you wouldn't want.

    you can assign that privilege with

    Type in secpol.msc /s

    Select "Local Policies" in MSC snap in

    Select "User Rights Assignment"

    Right click on "Log on as batch job" and select Properties

    Click "Add User or Group", and include the relevant user.

    Was this answer helpful?

    0 comments No comments