Link to home
Start Free TrialLog in
Avatar of Sony-Controlled
Sony-Controlled

asked on

Making a program run at startup

hello all i am making a program that iw ould like to have run everytime you start your computer how would i go about doint this ? what code to use ..l. please give expmples
Avatar of Brian Crowe
Brian Crowe
Flag of United States of America image

The easy way is to place a shortcut to your executable in the C:\Documents and Settings\[User]\Start Menu\Programs\Startup directory
Avatar of arif_eqbal
arif_eqbal

Another option is Adding an Entry into the Registry

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run

Add your own key under this RUN key and give the path of the EXE to run


Avatar of Sony-Controlled

ASKER

so for C:\Documents and Settings\[User]\Start Menu\Programs\Startup directory how excatly whould i get the exe to place a  shortcut there
ASKER CERTIFIED SOLUTION
Avatar of Thandava Vallepalli
Thandava Vallepalli
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Adding the registry entry would be a good solution, though startup isn't bad. I think a "service" is the optimal solution in many cases. The only caveat with the service is, if you go that route you need to think about if your app requires user interaction, ie does it have a gui? If so then you would need a helper app to control the service as a service is not meant to provide user interaction. I think there are some "solutions" to this but are unstable as well as other things. Just a suggestion.
no there is no gui
oh, there's no GUI? Then I think the service is the way to go, definitely. It is very simple and those links itsvtk posted explain them, I used them when I first learned.