Task scheduler - does not work with the option of not logged in user

Piotr 1 Reputation point
2022-10-03T07:50:21.937+00:00

I have a problem with the task scheduler on the new windows 10 Pro (19044.2075), ie regardless of whether the user is logged into the system. The Admin account is given, the password is also correct, in the batch login the Administrators group is added, but the script does not want to run the given schedule. the same steps on the old computer (only without Win10 update, version 19043.2006) work

if I check in the schedule, run if the user is logged in, the script will run

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. MotoX80 36,401 Reputation points
    2022-10-03T12:46:42.933+00:00

    Is the problem that the task scheduler is not launching the task or is the program/script being executed failing?

    Enable task history in the Actions pane and verify that the task is being launched. Look for errors.

    247033-image.png

    If the script is not working correctly, then you need to capture stdout and stderr to see what it's doing. See the answer in this post.

    https://learn.microsoft.com/en-us/answers/questions/1030430/open-a-task-working-in-background.html

    0 comments No comments

  2. Limitless Technology 39,926 Reputation points
    2022-10-04T08:09:30.547+00:00

    Hello there,

    Were there any recent updates made on your Windows 10 device? There are some updates in History which have broken the Task scheduler and make sure if this is caused by any updates.

    Check the dependency of the script on external resources because when you check this option "Run whether the user is logged on or not" It actually conflicts.

    The below thread discusses the same issue and you can try out some troubleshooting steps from this and see if that helps you to sort the Issue.

    Task Scheduler Problem (run whether the user is logged on or not) https://social.technet.microsoft.com/Forums/ie/en-US/c03d6691-b058-4f8d-961c-e8eba25bbaed/task-scheduler-problem-run-whether-user-is-logged-on-or-not?forum=w7itprogeneral

    Task Scheduler when user is not logged on https://learn.microsoft.com/en-us/answers/questions/119434/task-scheduler-when-user-is-not-logged-on.html

    ----------------------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept it as an answer–


  3. MotoX80 36,401 Reputation points
    2022-10-04T15:23:43.463+00:00

    Sorry, I cannot read whatever language that is.

    A few comments... a bat file is not executable by itself. Set the program to "cmd.exe" and put the bat file name in the arguments field. I recommend adding the /c switch to insure that cmd.exe terminates after executing the bat file.

    If you set the task to "Run only when the user is logged on", then the program will be launched in the context of the user's desktop session. That allows you to launch GUI programs like Firefox and notepad so that the user can interact with the program's window.

    When you have it set to "Run whether the user is logged on or not." then the launched program does not interact with the desktop. So you can initiate GUI programs like Firefox or notepad, but you can't do anything with them. You cannot "see" the window. There is nothing to click on. You need to run command line based programs like whoami.exe or ipconfig.exe so that you can capture stdout and stderr and see what messages the programs output.

    Please refer to the link that I posted. That describes how to capture the output.


  4. Shawn Andrews 0 Reputation points
    2024-11-07T02:39:02.2333333+00:00

    There are many things you can try but i have found the simplest method is to use the "schtasks" command run from windows terminal as administrator account. For an example here is a basic daily task run every day at 10 AM using the System account.

    schtasks /create /tn "MyDailyTask" /tr "C:\scripts\backup.bat" /sc daily /st 10:00 /ru SYSTEM

    Prior to this i had tried many different accounts from within taskscheduler, changed the security permissions on my task in the c:\windows\system32\tasks folder, run Task scheduler as an Administrator, lowered the User Account control settings to the lowest setting and none of these worked.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.