This question has already been answered:
- Automatic launch of the application 3 answers
There is a program written in python, which lines of code you need to add, so that it always runs and works when you start the OS Windos
This question has already been answered:
There is a program written in python, which lines of code you need to add, so that it always runs and works when you start the OS Windos
A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .
import getpass USER_NAME = getpass.getuser() def add_to_startup(file_path=""): if file_path == "": file_path = os.path.dirname(os.path.realpath(__file__)) bat_path = r'C:\Users\%s\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup' % USER_NAME with open(bat_path + '\\' + "open.bat", "w+") as bat_file: bat_file.write(r'start "" %s' % file_path) Add this code to your source. This code creates a .bat file in which your script runs. The .bat file itself is located in the Startup folder, which contains autorun applications at system startup.
Source: https://ru.stackoverflow.com/questions/777561/
All Articles