Python script as a Windows service
A quick tip on how to make a Python script run automatically as a Windows service.
- Create a .bat file with the command to launch the Python script:
"C:\some\path\to\your\python.exe" "C:\some\path\to\scripts_directory\your_script.py"
-
Open up a shell window with admin privileges.
-
Use NSSM to install the service:
"C:\some\path\to\nssm\win64\nssm.exe" install "Your Application Name" "C:\some\path\to\scripts_directory\run_application_script.bat"