Click here to Skip to main content
15,913,196 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

I want to start My Program when Windows has started.
With which Function?
Thanks.
Posted
Updated 29-Apr-12 8:47am
v2

1 solution

Hello Sasan

There are ways.

A good way is create a Windows Service instead of a normal application.
Look at this link: Creating a Windows Service in C#


Or add your program to Registery:
C#
RegistryKey add = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); 
add.SetValue("YourProgram", "\"" + Application.ExecutablePath.ToString() + "\); 


Better description, Look at this: Run the application at Windows startup
Or this: c# Add application under startup through programme

Or ...
Why don't you search google and find millions links?
 
Share this answer
 
v2
Comments
VJ Reddy 29-Apr-12 21:05pm    
Good answer. 5!
Shahin Khorshidnia 30-Apr-12 3:58am    
Thank you very much VJ
Sergey Alexandrovich Kryukov 29-Apr-12 22:39pm    
Agree, a 5.
--SA
Shahin Khorshidnia 30-Apr-12 3:58am    
Thank you very much SA
Mohamed Mitwalli 30-Apr-12 2:08am    
5+

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900