I have a program in Python and need it to start automatically with Windows, I could not find any material related to this on the internet.
I have a program in Python and need it to start automatically with Windows, I could not find any material related to this on the internet.
Any program whose shortcut you drag to this folder will run when Windows boots.
(If you need parameters from the command line for the program, you will need to create a .bat
file that does this.)
Click Start Menu > All Programs > Initialize
In English: Start Menu > All Programs > Startup
Inside the boot folder, place the shortcut of your .bat file that will open your python program when you start Windows.
To create the .bat file you can open Notepad and type this:
start Python caminho
Instead of path you place where your python file is .py . If the file is in the same folder as the .bat file, just put the file name. Example:
teste.py
Otherwise, you put the entire path, for example:
start Python C:/Users/User/Desktop/teste.py
At the time of saving as, do not forget to save as .bat file: start.bat
for example. Here is explaining a little about .bat if needed.
If it does not work, make sure the Python is in the system path .