A scheduled task reports success but does nothing, or fails 0x1
The task ran and the program inside it failed, or the task never ran because of how it is configured to run.
What you see
The Last Run Result column shows a code, or 0x0 with nothing having happened. Running the same command by hand works perfectly.
What is actually wrong
0x1 is the program's own exit code. 0x2147942402 is file not found. 0x41303 means it has never run. 0x800710E0 is the operator refusal that comes from the power conditions.
Codes and articles
Fixes (2)
Make the task's environment match the one you tested in
The task runs and the program fails.
Read the task's configuration.
Get-ScheduledTask -TaskName 'Nightly Export' | Select-Object -ExpandProperty ActionsGet-ScheduledTask -TaskName 'Nightly Export' | Select-Object -ExpandProperty Principal
Set the Start in field. A script that uses relative paths fails with no working directory set, which is the single most common cause of a task that works by hand and not on schedule.
$a = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument '-NoProfile -ExecutionPolicy Bypass -File C:\Scripts\export.ps1' -WorkingDirectory 'C:\Scripts'Set-ScheduledTask -TaskName 'Nightly Export' -Action $a
Without it, the task starts in C:\Windows\System32, so every relative path in the script points somewhere unexpected. The script does not error in a way that is obvious — it writes its output into System32 or fails to find its input.
Check the account it runs as has the rights it needs — including Log on as a batch job, and access to any network share.
Get-ScheduledTask -TaskName 'Nightly Export' | Select-Object -ExpandProperty Principal | Format-List UserId,LogonType,RunLevelA mapped drive does not exist for a task running as another account. Use UNC paths.
Drive mappings are per-session. A task running under a service account in session 0 has none of them, and the script fails on the first reference to Z:.
Capture the output so the failure is visible next time.
$a = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument '-NoProfile -File C:\Scripts\export.ps1 *> C:\Logs\export.log'Set-ScheduledTask -TaskName 'Nightly Export' -Action $a
Read the task's own history for what it thought happened.
Get-WinEvent -LogName 'Microsoft-Windows-TaskScheduler/Operational' -MaxEvents 60 | Where-Object Message -like '*Nightly Export*' | Format-Table TimeCreated,Id,Message -Wrap
Start-ScheduledTask -TaskName 'Nightly Export'Start-Sleep 30Get-ScheduledTaskInfo -TaskName 'Nightly Export' | Format-List LastRunTime,LastTaskResult,NextRunTime
Make the task actually start
It never runs, or is refused.
Check the trigger and the conditions.
Get-ScheduledTask -TaskName 'Nightly Export' | Select-Object -ExpandProperty TriggersGet-ScheduledTask -TaskName 'Nightly Export' | Select-Object -ExpandProperty Settings | Format-List DisallowStartIfOnBatteries,StopIfGoingOnBatteries,RunOnlyIfNetworkAvailable,RunOnlyIfIdle,WakeToRun
0x800710E0 is the operator refusal, and on a laptop it is almost always the battery condition.
$s = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -StartWhenAvailableSet-ScheduledTask -TaskName 'Nightly Export' -Settings $s
The default settings refuse to start on battery and stop the task if the machine unplugs. On a laptop or a virtual machine that reports a battery, that means it never runs and the message gives no hint why.
Set Run whether the user is logged on or not, so it runs without a session.
$p = New-ScheduledTaskPrincipal -UserId 'EXAMPLE\svc_task' -LogonType Password -RunLevel HighestSet-ScheduledTask -TaskName 'Nightly Export' -Principal $p -User 'EXAMPLE\svc_task' -Password (Read-Host -AsSecureString | ConvertFrom-SecureString -AsPlainText)
Enable Start when available, so a task missed while the machine was off runs at the next opportunity.
Check the task is enabled and the trigger date has not passed.
Get-ScheduledTask -TaskName 'Nightly Export' | Format-List TaskName,StateGet-ScheduledTaskInfo -TaskName 'Nightly Export' | Format-List NextRunTime,LastRunTime,NumberOfMissedRuns
Get-ScheduledTaskInfo -TaskName 'Nightly Export' | Format-List LastRunTime,LastTaskResult,NextRunTime,NumberOfMissedRunsWhere this stops. This write-up was written and checked by hand. It says what each step changes, how to confirm it worked and how to reverse it, and anything destructive is flagged before you reach it. If it does not match what your machine is doing, search the Support Centre for the exact code or message — and when something needs a person, get in touch.