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
2
votes
1 answer

Create a scheduled task with maximum privileges with schtasks

I've been browsing the docs of schtasks command and I didn't find any equivalent to the checkbox "Execute with maximum privileges" (rough translation here, sorry) in the scheduled task admin windows GUI (and /RU SYSTEM doesn't achieve it). Do you…
fbiville
  • 8,407
  • 7
  • 51
  • 79
2
votes
6 answers

Why do seemingly valid Python scripts fail to run when initiated via the Windows Task Scheduler?

I have been writing scripts in Python which I want to automatically run on a Windows server on a scheduled basis. I tried working with batch files very briefly, but have enthusiastically moved on to Python scripts instead and am doing fine with…
nairware
  • 3,090
  • 9
  • 37
  • 58
2
votes
1 answer

Scheduling a Python Script via Windows Task Scheduler

Observe the following Python script, "Script.py": import subprocess src_directory = 'Z:\z_7z\Some_Directory' zip_file_name = 'Test.7z' cmd = ['7z', 'a', zip_file_name, src_directory, '-mx9'] subprocess.Popen(cmd, stderr = subprocess.STDOUT, stdout =…
nairware
  • 3,090
  • 9
  • 37
  • 58
2
votes
1 answer

Is it possible to make schtasks run at specific times?

Is it possible to create a task using schtasks, such that this task runs at specific times depending on the configuration provided by the user? Ideally what I want to achieve is this - a user enters the specific times s/he wants the task executed…
ohseekay
  • 795
  • 3
  • 20
  • 37
1
vote
1 answer

win task scheduler fails to run an exe

I have an exe file which runs OK when I double clik on it (even when not Admin mode) When I run it through win-task-scheduler it fails right at the start. (I see it fails on configuring Nhibernate) 1) How can I configure the scheduler to run in…
Elad Benda
  • 35,076
  • 87
  • 265
  • 471
1
vote
1 answer

Running SCHTasks overs a large period of time gives strange results

We have a windows service that was developped a while ago which use a lot of scheduled tasks on a distant server. This might seem like a bad idea and it probably is, but since we are working with another company that will only work like that to…
David Brunelle
  • 6,528
  • 11
  • 64
  • 104
1
vote
0 answers

Running SCHTASK command in batch file with apache/php setup (windows)

I have multiple batch files containing lines like "schtasks.exe /create /tn NAME /tr \"cmd.exe /C \\\"start iexplore\\\"\" /sc once /st 03:05:43 /sd 12/18/2011" and I would like to have my PHP file execute the batch file and thus schedule the…
AbSoLution8
  • 1,203
  • 1
  • 18
  • 27
1
vote
1 answer

Mutex fails to limit running applications to one

I am writing a program to format and aggregate data to make it processable for power automate. However, I just noticed that one of my applications is able to run more than once at the same time, even though I used a mutex to surpress that…
crafter32
  • 56
  • 8
1
vote
0 answers

Obtain output from PowerShell script requiring Run As Administrator to ASP.NET GridView C#

I am managing an ASP.NET site providing users with managed access to various functionality on an IIS Server. The application is running on the .NET Framework 4.6.1 and the users are very happy with the features, mostly running SQL stored procedures.…
Tom Schulte
  • 419
  • 1
  • 6
  • 20
1
vote
1 answer

Task Scheduler : Console app with Log4Net not working

I am having one console app that having log4net(V-2.0.15) for logs. Configs are given below :
iDipa
  • 347
  • 2
  • 9
  • 20
1
vote
1 answer

Run Windows Task from Python file/script

I was checking but cant find it. Is there any way to trigger Windows Task, in Windows Task Scheduler from Python. It just needs to trigger a specific task from Python file/script nothin more.
IGRACH
  • 3,506
  • 6
  • 33
  • 48
1
vote
0 answers

Running batch script on a server, with windows OS

I have a server which is running 24/7 and I wanted to know how I can create a script that will run my code in an anconda enviornment I tried using the following code on Windows Task Scheduler, didnt work call…
Charan
  • 11
  • 1
1
vote
0 answers

How can I create a new scheduled Task when running script as "local system"?

I am not able to create a scheduled task under latest Win11 when running a Powershell script as "local system". It gets me an error "New-ScheduledTaskTrigger : Cannot connect to CIM server. Access to a CIM resource was not available to the…
Carsten
  • 1,612
  • 14
  • 21
1
vote
1 answer

Hidden Powershell Sheduled Task

I'm Running a Gaming PC and I wrote a Wallpaper Switching script in Powershell because Windows 11 doesn't allow me to set a Wallpaper Slideshow with the same Picture on Every Monitor. The Skript would be called on User login and every 30 Minutes…
1
vote
2 answers

Powershell to delete log files from log folder path older than 180 days

I need Powershell script to delete log files from log folder path older than 180 days, which can be performed using task scheduler. I wrote this script, but it's not working. $Path = "C:\Users\akshay.tanpure\Music\logs" $Daysback =…
Akshay
  • 13
  • 4