srk1982
asked on
Adding windows application programatically in windows startup
hi experts,
I have written an windows application. I will just pass the setup files to my client.
After he installs the setup file, the program will start running. But once the system is shut down or restarted. I want that application to be started automatically without any initiation from the user.
I have done this project in c# and i want to attain this programatically.
I have written an windows application. I will just pass the setup files to my client.
After he installs the setup file, the program will start running. But once the system is shut down or restarted. I want that application to be started automatically without any initiation from the user.
I have done this project in c# and i want to attain this programatically.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
RegistryKey hklm =Registry.LocalMachine;
hklm = hklm.OpenSubKey(@"SOFTWARE \Microsoft \Windows\C urrentVers ion\Run", true);
// To add your Application at Windows startup
hklm.SetValue(Application. ProductNam e, Application.ExecutablePath );
// To Remove the startup Application
hklm.DeleteValue(Applicati on.Product Name);
hklm = hklm.OpenSubKey(@"SOFTWARE
// To add your Application at Windows startup
hklm.SetValue(Application.
// To Remove the startup Application
hklm.DeleteValue(Applicati
Other option is to add a shortcut to starup folder
Open in new window