Click here to Skip to main content
15,902,634 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I want to know how to develop c#.net application that automatically runs when user turn on the system
Posted
Comments
Prasad_Kulkarni 25-Apr-12 6:06am    
You just need to create setup of your application and keep it in startUp it will run as your system starts.

 
Share this answer
 
v2
What you would google for is a "windows service"
 
Share this answer
 
Comments
[no name] 25-Apr-12 8:59am    
And to the univoter, care to explain why you downvoted a perfectly legitimate answer? Coward
Nelek 25-Apr-12 16:28pm    
Countered
[no name] 25-Apr-12 16:32pm    
Thanks
When deploying your application, use registry editor in setup project to set your application to start up.

Use the following link to know registry keys you need to set:

http://www.pctools.com/guides/registry/detail/109/[^]
 
Share this answer
 
v2
Hi,

There is a concept of RunOnce and Run

For RunOnce, Refer:


http://stackoverflow.com/questions/4504085/how-to-write-code-to-run-once-and-only-once[^]

In case of RunOnce, Apllication will start only once after starting the windows and In case of Run Apllication Runs each time when system started.
 
Share this answer
 
Windows Service OR
Control Panel -> Administrative Tools --> Task Scheduler.
Task Scheduler can run any .exe (Say Windows Forms program) at a pre-determined time.
 
Share this answer
 
Look here: Running a program at startup[^]

You need to use the Registry for running a program at startup:
C#
RegistryKey rk = Registry.CurrentUser;
RegistryKey StartupPath;
StartupPath = rk.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
if (StartupPath.GetValue("ProjectName") == null)
{
    StartupPath.SetValue("ProjectName", Application.ExecutablePath, RegistryValueKind.ExpandString);
}


Note: RegistryKey is in the System.Win32 namespace, hence don't forget to import it.
 
Share this answer
 

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