I have a small application with a CheckBox option that the user can set if they want the app to start with Windows.
My question is how do I actually set the app to run at startup.
ps: I’m using C# with .NET 2.0.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Several options, in order of preference:
HKey_Current_User\Software\Microsoft\Windows\CurrentVersion\Runregistry key. The only problem here is it requires write access to the registry, which isn’t always available.HKey_Local_Machine\Software\Microsoft\Windows\CurrentVersion\Runregistry key. The only problem here is it requires write access to the registry, which isn’t always available.This answer is older now. Since I wrote this, Windows 10 was released, which changes how the Start Menu folders work… including the
Startupfolder. It’s not yet clear to me how easy it is to just add or remove a file in that folder without also referencing the internal database Windows uses for these locations.