Reputation: 322
Is there a way to run my python 3 script at system boot on windows 7?
I know this has been asked a couple of times, but none of the solutions really filled my needs, because I prefer to stay with the free python interpreter rather than switching to ActivePython.
I have installed the Python for Windows extensions and would use py2exe, but it does not support Python 3.
Upvotes: 8
Views: 9685
Reputation: 9
You can use the sc
command. I am unable to test it right now but i think it would look like this:
sc create MyCoolService start=auto binpath=c:\mycoolprogram\supercool.exe obj=LocalSystem displayname=CoolService
Upvotes: 0
Reputation: 469
You can also use the Windows Task Scheduler using the following steps (skip quotes when typing):
Upvotes: 7
Reputation: 3121
Assuming that you have a fully woking stand alone exe file that's been generated from your python script using py2exe
, you can just add a new string with some random key and value as the absolute path
of your exe file under HKLM\Software\Microsoft\Windows\CurrentVersion\Run
of windows registry
(accessible by running regedit
from Window's run
prompt). This will run the exe file whenever your Windows 7 boots up !
Upvotes: 2