Adding a Python script to windows start-up basically means the python script will run as the windows boots up. This can be done by two step processe –
Step #1: Adding script to windows Startup folder
After the windows boots up it runs (equivalent to double-clicking) all the application present in its startup directory.
By default the AppData folder under the current_user is hidden so enable hidden files to get it and paste the shortcut of the script in the given address or the script itself. Also the .PY files default must be set to python IDE else the script may end up opening as a text instead of executing.
Step #2: Adding script to windows Registry
This process can be risky if not done properly, it involves editing the windows registry key HKEY_CURRENT_USER from the python script itself. This registry contains the list of programs that must run once the user Login. just like few application which pops up when windows starts because the cause change in registry and add their application path to it.
Below is the Python code :
Note: Further codes can be added to this script for the task to be performed at every startup and the script must be run as Administrator for the first time.
- How to Run a Python Script
- Running Python script on GPU.
- Run python script from anywhere in linux
- Python | Accepting Script Input
- Get Your System Information - Using Python Script
- Add a User in Linux using Python Script
- Get directory of current Python script
- Convert Python Script to .exe File
- Schedule a Python Script on PythonAnywhere
- Run Python Script using PythonShell from Node.js
- Python Script to Logout Computer
- Python Script to Shutdown Computer
- Python Script to Restart Computer
- Python script to get device vendor name from MAC Address
- Deleting a User in Linux using Python Script
- Create a Python Script Notifying to take a break
- How to add Python to Windows PATH?
- How to install Python on Windows?
- IDE for Python programming on Windows
- Python script to open a Google Map location on clipboard
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.