1,105,232 Community Members

How to run a python script at windows startup?

Member Avatar
dilbert_here00
Light Poster
32 posts since Feb 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
1
 

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

Member Avatar
snippsat
Veteran Poster
1,039 posts since Aug 2008
Reputation Points: 483 [?]
Q&As Helped to Solve: 381 [?]
Skill Endorsements: 10 [?]
 
3
 

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

Member Avatar
dilbert_here00
Light Poster
32 posts since Feb 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
dilbert_here00
Light Poster
32 posts since Feb 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

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 :)

Question Answered as of 2 Years Ago by snippsat
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article