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

Installing And Exploring Auto Dark Mode Software

Windows Auto--Night--Mode: Simplify Your Theme Switching   Windows Auto--Night--Mode is a free and lightweight tool that makes switching bet...