Thursday, June 16, 2011

C# how to Run the application at Windows startup


private void RegisterInStartup(bool Checked)
{
    RegistryKey registryValue= Registry.CurrentUser.OpenSubKey
            ("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
    if (Checked))
    {
        registryKey.SetValue("startupApplication", Application.ExecutablePath);
    }
    else
    {
        registryKey.DeleteValue("startupApplication");
    }
}

2 comments:

  1. In which place i write this coding

    ReplyDelete
  2. create a windows application in visual studio. there you can use this code to add your application to start at the windows startup.

    ReplyDelete

Thank you for Commenting Will reply soon ......

Featured Posts

🌫️ Project Title: "Fog Buster – AI-Powered Visibility Enhancement System"

🔍 Project Vision: To design a device that allows vehicles (cars, trucks) and aircraft (planes, helicopters, drones) to see clearly during f...