Click here to Skip to main content
15,900,378 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to make the software run automatically after starting the system in c# coding?
Posted
Updated 30-Jan-11 0:55am
v2
Comments
Henry Minute 30-Jan-11 6:58am    
Please use a more descriptive title.
You will get more help if people can see what you want to do before they open your question.

I have modified it for you. Please change it if you have an alternative.

There are few ways to this

1) Place a short cut to your application in the startup section.
2) Allow your application to load from a windows service.
 
Share this answer
 
Comments
Espen Harlinn 30-Jan-11 7:21am    
5+ works nicely :)
Abhinav S 30-Jan-11 10:54am    
Thanks Espen.
Sergey Alexandrovich Kryukov 30-Jan-11 23:28pm    
That's not bad (a 5, mostly for not forgetting Windows Service).
As to start-up section, this is only a method working for an individual account, not for the system in general, also, there are different steps where the application can be registered.
I have my own way to keep the knowledge on all the relevant registry locations -- please see my answer -- this is SysInternals AutoRuns.
Thank you.
--SA
Abhinav S 31-Jan-11 1:11am    
Pretty good SA.
Sergey Alexandrovich Kryukov 31-Jan-11 1:45am    
Thank you; at least it helps me.
--SA
The answer given by Abhinav S works fine, and here is how to do it using the registry:
Windows Program Automatic Startup Locations[^]

Regards
Espen Harlinn
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 30-Jan-11 23:24pm    
That's good (a 5), but I have more "automated" approach using SysInternals AutoRuns. Please see my answer.
--SA
First of all, writing a Windows Service is a serious option. It gives important benefits over regular applications, but also more difficult to develop and debug.

For all other ways, I have a different, more comprehensive method which I find very robust. You can find all different ways to register application for loading once or on regular basis following SysInternals application called AutoRuns:

1) Go to SysInternals site: http://technet.microsoft.com/en-us/sysinternals[^].
2) Download SysInternals Suit: http://download.sysinternals.com/Files/SysinternalsSuite.zip[^]; you can also download separate applications, but there are more useful things, read utilities Index: http://technet.microsoft.com/en-us/sysinternals/bb545027[^].
3) Unpack and run AutoRuns, read it help and look at the top-level items of the tree: they show when you can install your applications.
4) Activate context menu and select "Jump To"; it will open Regedit on a selected item.
5) Write installation application which writes the path to your application and parameters in a right place in the Registry.

Good luck,
—SA
 
Share this answer
 
Comments
Sandeep Mewara 31-Jan-11 0:27am    
Great(5)! Good to know... Thanks for sharing. :)
Full question bookmarked for future ref!
Sergey Alexandrovich Kryukov 31-Jan-11 0:36am    
Thank you, Sandeep.
Good idea to reuse Answers like this -- this is of repeating questions.
What is funny, I've just posted 5(!) answers advising using SysInternals utilities: also to detect DLLs holding files and forceful deletion of such files and serial port spy -- SysInternals provides excellent stuff.
--SA
Espen Harlinn 31-Jan-11 15:20pm    
5+ - Good answer to a popular question :)
JF2015 1-Feb-11 8:32am    
Nice - I like!
Same question asked and replied here[^].
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 30-Jan-11 23:23pm    
Thank you Sandeep (a 5).
As I have my own approach based on SysInternals, I updated both pages. Please see my answer.
--SA

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