Yes, I use windows, the task scheduler is finnicky but once you get it to work once you don’t really have any problems.
Tips:
- If you need access to certain filesystem privileges you will need to create the task using an administrator account.
- You will need to check off “Run whether user is logged on or not” :
This unintuitively tells windows not to draw a new cmd window and just run it in the background instead. - The action to do will be “start a program” Here is an example:
- Then change all the “Where when why” stuff to your liking.
- You put what python executable you want to run as the program
- You put the name of your script as the ‘argument’ (if you have more arguments, they go after the script name)
- You put where your script resides as ‘start in’ if you don’t want the current working directory to be your python path. (You could also put this any place you want your current working directory to be, that’s why its optional)
- Be aware all of these are very weird with how windows handle quotation marks and paths
The last thing is once you get something working the way you want, you may just want to export the task to a file, and edit the XML directly because that is surprisingly slightly less M$FT kinds of insane. Then re-upload a new version for a different script / job / task etc.
You might want to save this task xml in your project file just for fun, if you want to load it on a different machine, you will have to change the USER in the xml before you import it, and windows will ask you to put in the password every time you make a change. It does not store this password in the XML. (for obvious reasons)