Questions tagged [windows-task-scheduler]

Use for questions about programmatic modification of task scheduling on any version of the Windows OS.

The MS Windows system scheduler component manages the execution time (time slices) that competing processes & threads are given on available processor cores.

Tag usage

The task is for questions about programmatic modification of task scheduling on any version of the Windows OS. You should also tag questions with their specific Windows version, where relevant.

Related tags

References

Microsoft documentation is the primary source for documentation about Windows Scheduling. You may refer the following topics for more information:

845 questions
230
votes
8 answers

How can I enable the Windows Server Task Scheduler History recording?

I have a Windows Server 2008 with scheduled tasks running, mainly .bat files calling PHP files. I have 2 users on the server, one Admin and the other is a Standard user. I used the Standard User to clear the history log in the Task Scheduler…
martti d
  • 2,552
  • 2
  • 17
  • 20
167
votes
5 answers

Why does my Task Scheduler task fail with error 2147942667?

I have scheduled a task to lauch a batch file. When I run the task with the option Run only when user is logged on everything works fine. I want to run this task in the background, hence I am running it using the option Run whether user is logged…
Alok
  • 3,160
  • 3
  • 28
  • 47
139
votes
16 answers

WSL2 Clock is out of sync with Windows

WSL2 clock goes out of sync after resuming from sleep/hibernate. A workaround was shared on GitHub sudo hwclock -s to resync clock in WSL, but you have to do this every time you resume from sleep/hibernate.
piouson
  • 3,328
  • 3
  • 29
  • 29
84
votes
10 answers

Task Scheduler failed to start. Additional Data: Error Value: 2147943726

I am using windows 10 task scheduler to run tasks that require me using my personal user account (its necessary to use my user and not system user because of permission issues - I am part of an organization). In windows 7 computers everything worked…
misha312
  • 1,443
  • 4
  • 18
  • 27
80
votes
7 answers

How do I execute a PowerShell script automatically using Windows task scheduler?

I have one PowerShell script which sends emails. I want to execute that script automatically, every 1 minute. How can I do it, using task scheduler? Currently I have created a task and provided the path of my script. But that scheduler opens my…
AK47
  • 3,707
  • 3
  • 17
  • 36
69
votes
16 answers

Windows Scheduled task succeeds but returns result 0x1

I have a scheduled task on a Windows 2008 R2 server. The task includes a Start In directory entry. The task runs, and the batch file it runs does what it is supposed to do. When I run the batch file from a command prompt, I see no errors. The…
user241099
  • 818
  • 2
  • 7
  • 7
59
votes
13 answers

The operator or administrator has refused the request task scheduler

I have scheduled a C# console application in Task Scheduler of Windows 2012 R2. Application will run when executed it manually or Right click on scheduled task and click on Run, but it is failed when triggered by Task Scheduler with below…
Sushmit Patil
  • 1,335
  • 1
  • 14
  • 26
51
votes
21 answers

Windows Task Scheduler doesn't start batch file task

I have a batch file with the code below to stop and start the SQL Report service: net stop "SQL Server Reporting Services (MSSQLSERVER)" timeout /t 10 net start "SQL Server Reporting Services (MSSQLSERVER)" I have set up the scheduled task to…
jimminybob
  • 1,392
  • 2
  • 24
  • 60
47
votes
7 answers

Specifying the running directory for Scheduled Tasks using schtasks.exe

I have an application which gets called by a scheduled task. It moved from Windows Server 2003 to Windows Server 2008. On 2003, the app ran in the directory where the executable was located. On 2008 Environment.CurrentDirectory (C#) reports that…
33
votes
9 answers

Run a python script in virtual environment from windows task scheduler

I'm trying to set up a recurring Python task through windows task scheduler. I have had success when I input the path to 'python.exe' and provide the script's path as a parameter to windows task scheduler (see screenshot below) However, I want to…
deseosuho
  • 958
  • 3
  • 10
  • 28
20
votes
2 answers

How to create a scheduled task under SYSTEM user account with SCHTASKS

I am currently trying to get SCHTASKS to create a scheduled task under the SYSTEM account, by using the following command: schtasks.exe" /s "\\" /u "SYSTEM" /Create /SC DAILY /MO "7" /ST "12:00" /TN "mytask" /TR "C:\test.exe "C:\"" Although it…
Mike
  • 305
  • 3
  • 5
  • 7
19
votes
6 answers

How to run Application.exe before windows startup?

I have a windows application with user Interface that do some stuff... Now my client wants that, when he pushes the power button MyApplication run before he forced to input the username and password! comment: the system is multi user on windows XP…
vesna
  • 403
  • 1
  • 3
  • 13
16
votes
3 answers

Change settings for power for windows scheduled task

I created a windows task and scheduled to run every 1 hour. Every hour the task runs but am getting an warning Task Scheduler did not launch task "\Sample Task" because computer is running on batteries. User Action: If launching the task on…
Sunil Agarwal
  • 4,097
  • 5
  • 44
  • 80
15
votes
1 answer

how to schedule a task for every 5 minutes in windows command prompt?

I'm currently scheduling .bat files using Windows Task Scheduler. However, I want to do this using the Command Prompt's schtasks command. My batch file should run every five minutes and repeat its task every day.
14
votes
4 answers

Powershell and schtask with task that has a space

I am using the schtask command with PowerShell. The problem that occurs is, when the program/script argument contains C:\Program Files\, it thinks the path is just C:\Program and the rest of the path is an argument. I have tried to escape it by…
Brad Semrad
  • 1,501
  • 1
  • 11
  • 19
1
2 3
56 57