Hello ALL,

I was wondering if there is a way to run a python program at windows startup, without running the script as a windows service?

I have a python program which runs a bunch of functions & then sometimes restarts the computer. At startup I want my script to run automatically till all the functions are executed.

Is there an easy way to implement this? Thanks in advance for your help.

Regards

If .py files are assigned to be opened by python on your system, then you only need to put a shortcut into your startup folder.
C:\Documents and Settings\All Users\Start Menu\Programs\Startup

More andvance solutions is.
- add it to the windows registry (HKCU\Software\Microsoft\Windows\CurrentVersion\Run)
- package it into a service, that should then be installed

If .py files are assigned to be opened by python on your system, then you only need to put a shortcut into your startup folder.
C:\Documents and Settings\All Users\Start Menu\Programs\Startup

More andvance solutions is.
- add it to the windows registry (HKCU\Software\Microsoft\Windows\CurrentVersion\Run)
- package it into a service, that should then be installed

Hi Snippsat,

Thank you for your response. I am using win 7, & I tried adding an entry to "HKLM/SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" with my python script, but i keep getting Error 5. Access is denied. I verified i have adequate permissions, & I am manually able to change the key. Any idea why this is happening?

Thanks & Regards

Hi Snippsat,

Thank you for your response. I am using win 7, & I tried adding an entry to "HKLM/SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" with my python script, but i keep getting Error 5. Access is denied. I verified i have adequate permissions, & I am manually able to change the key. Any idea why this is happening?

Thanks & Regards

Hey it worked i just had to right click & run my script as administrator.

Thanks :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.