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

How to pass in parameters to bat file via asp.net schtasks

I am trying to use the Windows Process.start service in Visual Studios 2005 to call Windows task scheduler (schtasks) which calls the bat file. The process works fine except that the bat file takes in parameters but it won't work when I am trying to…
2
votes
0 answers

Run python script with args using windows scheduler

I wrote a script which take one switch and args like: python testScript.py --runMode 4 It works when run on cmd. I have tried this same script using the windows scheduler but no luck .Is it possible to run the script which take args using the…
Shashi
  • 2,137
  • 3
  • 22
  • 37
2
votes
1 answer

Schedule task with a single quote in path name or parameter

The task to schedule is something like: notepad.exe "D:\ben's notes\foo.txt" After some digging I managed to get the /TR parameter to accept the spaces: "notepad.exe \"D:\ben's notes\foo.txt\"" However schtasks.exe also replaces every single quote…
Kempeth
  • 1,856
  • 2
  • 22
  • 37
2
votes
0 answers

TaskScheduler won't run a script

I want the windows Task scheduler to run a *.bat File to run a python script. Problem is, when I launch the *.bat File directly, I get Errorcode 0x1 in Task scheduler. After searching I found that I need to set "Run with highest Privileges" on first…
Lukas Fürst
  • 81
  • 11
2
votes
0 answers

Python subprocess get stdout of other process opened by batch script using pid

I'm launching batch script from windows task scheduler using subprocess. But the problem here is that the subprocess is linked to the task scheduler command output but not to the output of "Task Scheduler opened bat CMD Window" from subprocess…
2
votes
2 answers

SAS program in Task Scheduler does not execute a subprocess using %sysexec

My Task Scheduler calls a Powershell script that starts a SAS program, which in turn executes a Windows command using %sysexec (and does a lot of other stuff on the side). When I run the Powershell script interactively or start it manually in the…
Martin F.
  • 57
  • 6
2
votes
1 answer

How to fix "last run result (0x2331)" when running a python script on Windows Task Scheduler?

Dependencies OS : Windows 10 Pro (64 bit) IDE : Spyder 3 (Anaconda 3) with Python 3.9.7 Absolute path to python exe : C:\Users\user\AppData\Local\Microsoft\WindowsApps\python.exe Absolute path to python script :…
2
votes
2 answers

Task Scheduler executes script but does not output to log file

I am running into the following issue : I have a task scheduler job running across a number of Azure VMs, it is scheduled to run at ~11pm every wednesday. From what I can see the script executes the required change, however it does not generate the…
Dunner1991
  • 19
  • 3
2
votes
1 answer

Using Python Script to run an Alteryx workflow via the Microsoft Task Scheduler on Remote Desktop

my python script works perfectly fine as long as I'm logged into the remote desktop while the task scheduler initiates it. However, if I'm no longer connected to the remote desktop, it terminates because pyautogui has a Failsafe. When I turn the…
KeyaD77
  • 21
  • 6
2
votes
2 answers

How to start a .exe with Task Scheduler when its path keep changing for each new version?

I want to start the new Google Drive with Task Scheduler but its path includes the number of the version so it keeps changing. The path is currently C:\Program Files\Google\Drive File Stream\53.0.8.0\GoogleDriveFS.exe but the 53.0.8.0 part will…
MagTun
  • 5,619
  • 5
  • 63
  • 104
2
votes
1 answer

Using schtasks.exe, how do I create a Scheduled Task, then delete it afterwards?

I have a .bat file which needs to schedule a command at 5:00 PM. I cannot use Task Scheduler, because at the end of the file I need to delete the scheduled command (cancel it), without having to manually confirm the delete! I need an alternative to…
User not found
  • 479
  • 3
  • 15
2
votes
0 answers

Windows task scheduler not running a batch file that calls a python selenium script

Desired Result Hi, I am using a machine running windows 10 to automate a scraper that is written in python and uses selenium (with chrome driver). I want this to run every day at 3:00 am. Best Attempt It seems the best way to do this is to write a…
2
votes
1 answer

How do I force saveWidget to create a single file outside of RStudio?

In RStudio I can save my html widget to a single file with: htmlwidgets::saveWidget(x,"filename.html",selfcontained=TRUE) When running an R script with the above line through windows Task Scheduler (which calls Rscript.exe) this would generate a…
2
votes
0 answers

Process runs in Powershell Prompt but not as a scheduled task?

$taskTrigger1 = New-ScheduledTaskTrigger -Once -At 2:50PM $taskAction = New-ScheduledTaskAction ` -Execute "powershell.exe" ` -Argument "-ExecutionPolicy ByPass -File `"\tiddlywikiIIS_schtask_rsync\backup.ps1`"" $taskName = "Backup…
2
votes
1 answer

PowerShell run Scheduled Task on another server

I have serverA that contains all my powershell scripts. I have serverB that has Windows Scheduled tasks. How do I call and execute a Scheduled Task on serverB from serverA? I have tried the below from serverA Start-ScheduledTask -TaskName "LoadJobs"…
Michael
  • 2,507
  • 8
  • 35
  • 71