29 votes
Accepted

How to schedule a task to call a URL

Use the Invoke-WebRequest cmdlet from Powershell. In your task: Action: Start a program Program/script: powershell.exe Arguments: -Command "Invoke-WebRequest http://myapp/BackgroundTask/Run"
Ryan Bolger's user avatar
  • 16.8k
17 votes

.NET Core console app fails from task scheduler with 0xC0000005

I searched and tried all kinds of solutions and the one that worked for me was to set the Start In option. Normally someone could have the full path in the Program/Script text box after browsing, ...
Breadtruck's user avatar
16 votes
Accepted

How do you restart the Task Scheduler service without rebooting the server?

The only way I could stop this service without rebooting the server was to run a command prompt using the service account. Do this I used PsExec from Sysinternals psexec -i -s cmd In the new window ...
Ro Yo Mi's user avatar
  • 328
15 votes

Ubuntu cron job every workday

These syntaxes are valid for all working days a 8:00 AM : 0 8 * * 1-5 /path/to/command >/dev/null 2>&1 0 8 * * 1,2,3,4,5 /path/to/command >/dev/null 2>&1 as you said @aleksandar-...
Maximilien D's user avatar
10 votes

powershell scheduled task always shows running even once completed

Just a tiny note: If you run a task manually it will go to "running" in task scheduler library. Wait until your task finishes and then hit F5 to refresh.
Sniipe's user avatar
  • 201
10 votes

Task scheduler scheduled task at startup not working

I struggled a while with the same problem. In my case, the problem was the setting "Start the task only if the computer is on AC power".
Sebastian Badea's user avatar
8 votes
Accepted

How do I create a scheduled task that will run as the logged in user

If you run Task Scheduler as Administrator, the option to Change User or Group will be available. There you can set the task itself to run as a non-privileged group.
jcrossbeam's user avatar
8 votes
Accepted

Scheduled task runs with exit code 0, but powershell script is not always executed

I think the exit code task scheduler is reporting is for running powershell.exe not your script. Try changing it to this: -ExecutionPolicy Bypass –NoProfile –Command "& {C:\ProgramData\ORGNAME\...
Peter Hahndorf's user avatar
7 votes

schtasks - create task with no schedule that runs on demand

Instead of using a dummy time in the past or future, you can set the task to run on a dummy event: SCHTASKS /Create /TN TaskOnEvent /TR notepad.exe /SC ONEVENT /EC Application /MO *[System/EventID=...
harvey263's user avatar
7 votes

What is the best way to run cronjob in AWS ECS?

I'm not familiar with Laravel or Artisan but essentially you'll need to: create a container image with your job (artisan) create a task definition that runs the artisan container when invoked create ...
MLu's user avatar
  • 25.3k
6 votes
Accepted

Back up a database nightly

Back up a database nightly I have a development database that I would like to refresh with the data from the Production database. I would like for this to happen every evening if possible. ...
Pimp Juice IT's user avatar
6 votes

Register-ClusteredScheduledTask : The parameter is incorrect

I was able to resolve this issue by choosing a different task name. I have seen this under two circumstances: I have a scheduled task that has become corrupt. Even deleting it won't free up the task ...
austincrft's user avatar
6 votes

Powershell Script will run but screen capture not completed, why?

Your problem is that by choosing "runs whether user is logged on or not", you're basically telling the task to run in session 0 which is not your logged on desktop. More detailed info is available in ...
Ryan Bolger's user avatar
  • 16.8k
5 votes

How do I rename a task in Task Scheduled on Windows Server 2008 R2

Short Version You can't rename a scheduled task because that would change the SID the task runs as. The name forms the Security Identifier (SID) of the user the task will run as. Renaming the task ...
Ian Boyd's user avatar
  • 5,373
5 votes

Process runs slower as a scheduled task than it does interactively

Here's a powershell snippet for setting the priority (works in a remote powershell session!): $taskName = "MyTask" ;` $currentTask = Get-ScheduledTask -TaskName $taskName ;` $settings = $...
Hank Killinger's user avatar
5 votes

Windows Server 2016 scheduled task schedule must be in future

FYI - I have confirmed with Microsoft through a support ticket I opened yesterday that this is a bug. The support tech confirmed it is internally classified as a bug and a patch is being developed. ...
Tom Collins's user avatar
5 votes
Accepted

GPO not applied, gpresult /R OK -- scheduled task not created

Found the issue. Used this : https://support.microsoft.com/en-us/help/2447414/user-gpp-scheduled-task-item-fails-to-apply-and-logs-event-id-4098-with-0x80070005-access-is-denied. To avoid this ...
Alex Lum's user avatar
  • 165
5 votes
Accepted

Windows Task Scheduler deletes batch file upon running it

It turned out to be Avast detecting the scripts as viruses and deleting them. It had to be configured to allow the .CMD files to be run by Task Scheduler.
Jez's user avatar
  • 1,433
5 votes

Task scheduler scheduled task at startup not working

You are executing this Task with "VM" user privileges. Does "VM" account have "Run as a batch Job" rights? How are you setting up your scheduled task, through local Task Scheduler or through DC GPO ...
toofat's user avatar
  • 311
5 votes

Ubuntu cron job every workday

Finally tested and found the answer, so 1-5, or MON-FRI does not work, what works is 0 8 * * 1,2,3,4,5 /path/to/command
Aleksandar Pavić's user avatar
5 votes
Accepted

Can scheduled task actions run in parallel?

The official documentation says : Be aware that when multiple actions are specified, they are executed sequentially. There are no official ways to change this behavior, however, you can create ...
Swisstone's user avatar
  • 6,870
4 votes
Accepted

Task Scheduler with Virtual Accounts, possible?

You can't run it as a virtual user account. But you can run it with a virtual group account. (But since that that "group" has a 1:1 relationship with the task, it effectively is a user). ...
Ian Boyd's user avatar
  • 5,373
4 votes
Accepted

windows scheduled task is killed (timed out) too soon

The Trigger ExecutionTimeLimit has priority over the Task ExecutionTimeLimit. <ExecutionTimeLimit>PT20H</ExecutionTimeLimit> If both are specified, the Task time limit is ...
Greg Askew's user avatar
  • 36.6k
4 votes
Accepted

powershell scheduled task always shows running even once completed

Even though the script was doing everything it was configured to it seems I needed to place all of the arguments inside quotes. Old arguments (everything completed fine but task hung): -...
Aaron O's user avatar
  • 71
4 votes

PowerShell script running from scheduled task: action failed to start, directory name invalid

Use the following syntax to run a PowerShell script in task scheduler: Program/script: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Add arguments: -NoLogo -Noninteractive -Noprofile -...
Sam Erde's user avatar
  • 3,467
4 votes

How to run a script on a server 1 minute after a commit has been made?

Write a git post-commit hook that contains a call to at time+60
stark's user avatar
  • 369
4 votes
Accepted

Almost All Scheduled Tasks Fail: The system cannot find the file specified. (0x80070002)

Since there is no answer at all, I answer how I would break it down: create the task with a uniqe name run procmon.exe search for the name of the task (you will find a svchost.exe) rightcklick PID (...
marsh-wiggle's user avatar
  • 2,185
4 votes
Accepted

If two scheduled tasks are missed, in which order will they run next?

The order is not specified, it's an implementation detail. So you can't rely on the execution order, because it can be random, or change with Windows updates. You have two options here: Disable Run ...
Swisstone's user avatar
  • 6,870
4 votes
Accepted

Why does a scheduled task access the database as anonymous (vs configured acct)?

Turns out this is similar to the double hop issue. To resolve it, I ran Enable-WSManCredSSP Client –DelegateComputer <schedTaskHost> on the task server and Enable-WSManCredSSP Server on the SQL ...
uSlackr's user avatar
  • 6,432
3 votes

"The user account does not have permission to run this task"

"The Task runs under domain credentials (which also happen to have local Administrators membership). When the Task is created, I get the same "the user account does not have permission to ...
Ivan Chau's user avatar
  • 271

Only top scored, non community-wiki answers of a minimum length are eligible