28

I'm trying to schedule a task in Windows 10, on the event of "At log on" in order to start several programs, but it won't run after several trial/error. The task is configured as follows:

  • General: Run whether user is logged on or not (it prompted the credentials inputbox, also tried Run only when user is logged on). Run with highest privilegies. Configure for Windows 7 and Windows 10 options where tried.
  • Triggers: At log on, any user, enabled (tried specific user too).
  • Actions: Start a program, which are "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", "C:\Program Files\Internet Explorer\iexplore.exe" (this one has Add Arguments: %HOMEDRIVE%%HOMEPATH%), "D:\ids\sqldeveloper\sqldeveloper\bin\sqldeveloper64W.exe". The route were copy/paste from the shortcut properties of each program.
  • Conditions: No condition were set.
  • Setting: No additional settings.
  • History: disabled.

When I restart and log on, nothing happens. Checking the status panel appears the summary of the task, where in the Last Run Time is 30/11/1999 12:00:00 a.m., the Last Run Result is (0x41303), and Status column is Ready.

Tried to look others questions, but seems to be others problems. What am I missing? Is there another configuration that I must apply? Thanks in advance.

SteveC
  • 15,808
  • 23
  • 102
  • 173
Sebastian Motavita
  • 355
  • 1
  • 3
  • 9
  • 1
    I had the 41303 error, but I'd forgot I'd ticked "on idle" condition – SteveC Aug 12 '18 at 10:14
  • Do you find an answer here? https://social.technet.microsoft.com/Forums/en-US/0caf50d4-a436-4902-9627-e53f7001648e/scheduled-task-does-not-run-and-stays-at-0x41303?forum=win10itprogeneral – Dominique Feb 15 '19 at 08:54
  • 1
    @Dominique. Unfortunately no. This still looks to be a problem even after so many years. – Vaibhav Jain Oct 17 '19 at 12:26

11 Answers11

13

I had this problem as well (Windows Server 2019), with error 0x41303 and Last Run Time set to 30/11/1999.

When I changed the start time to a future time instead of past (i.e. 2 minutes from current time), the scheduled task ran successfully (result: 0x0) and repeated just fine per the trigger.

SaeX
  • 17,240
  • 16
  • 77
  • 97
  • 1
    This works perfectly for me. It definitely should be accepted. – tigertang May 15 '20 at 04:08
  • 1
    I didn't think your solution was going to work... after hours of trying to fix it... I finally tried and fixed it exactly as you said :-) mistery of windows... thanksss! – BitQuestions Mar 12 '21 at 11:09
6

Task Scheduler 0x41303: Task has not yet run.

The main reason for this is if the scheduler's first run is set in the past or simply hasn't run yet. To fix:

  • Try running it manually
    or
  • Set the next trigger in the near future.

    The last run result should update indicating it ran but if it still doesn't run, check the task conditions.
    A full list of task scheduler return codes
webberist
  • 61
  • 1
  • 4
2

Got the same error code when scheduling a python script, fixed it by changing Conditions > Network to "Any connection" or disabling it entirely.

Patrolin
  • 106
  • 1
  • 5
  • Dude you save my whole week :), I had problem with Chrome driver while scraping data from sites, and when I run manually console application it works without problem but when I run app with task scheduler I got exception Chrome unreachable. – TJacken Sep 21 '20 at 22:11
2

Try open "trigger" tab, and edit the trigger detail. I found here my trigger was not enabled, I've just enabled it. This could generate error 0x41303.

Eric Draven
  • 259
  • 3
  • 7
1

I had spaces in my script that was being called and had to change it to have quotes around it. Maybe this will help someone

  • 1
    I noticed that this is your first post. In the future please note that StackOverflow uses a different design than forum threads or reddit style threads. Please only post Answers which completely, clearly, and thoroughly describe a solution or explain the problem. As your answer currently stands it would have been better as a comment. Welcome to StackOverflow, and good job answering your own question :) – Ace.C Apr 30 '20 at 19:11
1

On General Tab: Choose "Run whether user is logged on or not" Tick "Run with highest priviledge"

On Trigger Tab: Make sure status is "Enabled"

0

Use "&&" in between the commands instead of commas and as far as possible try to give the absolute path to the arguments, hope this helps.

OR

You can create a ".bat" file with the different commands in it.

0

I think there's several possible reasons for this Last Run Result code. If you enable the task History and try running the scheduled task manually, you can check the History tab for events and should be able to get more information, such as an error code or error reason. Once you have that, you should be able to Google for the specific error message that you're getting.

deadlydog
  • 22,611
  • 14
  • 112
  • 118
0

In my case the run user (-User) was disabled and I constantly receive the code 267011 (0x41303). To check it run Get-LocalUser.

Andrei Kovrov
  • 2,087
  • 1
  • 18
  • 28
0

Setting the trigger start further into the future didn't seem to help. While not always going to be the right solution, running the task as SYSTEM got rid of 0x41303 for me.

$script = { "hello world" | write-host }

$registerJob = {
    param($script)
    $taskName = "Hello World"
    Unregister-ScheduledJob -Name $taskName -ErrorAction Ignore
    $job = Register-ScheduledJob -Name $taskName -ScriptBlock $([scriptblock]::create($script)) -RunEvery $([TimeSpan]::FromMinutes(1)) -MaxResultCount 1
    $psSobsSchedulerPath = "\Microsoft\Windows\PowerShell\ScheduledJobs";
    $principal = New-ScheduledTaskPrincipal -UserId SYSTEM -LogonType ServiceAccount 
    $someResult = Set-ScheduledTask -TaskPath $psSobsSchedulerPath -TaskName $taskName -Principal $principal
}

# Run as Administrator needed in order to call Register-ScheduledJob
powershell.exe -command $registerJob -args $togglePowerOverlay
KrisG
  • 119
  • 5
-1

In my case I launch task using another domain account but this account doesn't had rights for this. I added rights for launch task using this instruction.