Click here to Skip to main content
15,890,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hey guys

i'm trying to write a processor manager, and i want to know how i can set this program as a startup program?

i search google, and in forums peoples said that the programmer have to do something with windows register, but how? don't know!

can any one guide on this?

thanks in advance
Posted

You can create a registry key that will always be executed at startup

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Have a look in regedit to see existing entries in there so you know how it should read. Simply create a value and point it at your program
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 1-Mar-11 12:11pm    
Not as good as Sandeep's, but 5.
--SA
Have a look at this answer: Running a program at startup[^]
It says, you can do it usin Registry. The following code shows how to do this:
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);
}
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 1-Mar-11 12:10pm    
Correct, my 5.
--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