I have a small WPF Application. I'm trying to get it started on Windows startup My C# code as follows:
using (RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true))
{
key.SetValue("MyApp", "\"" + System.Reflection.Assembly.GetExecutingAssembly().Location + "\"");
key.Close();
}
and deleted RegistryKey:
using (RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true))
{
key.DeleteValue("MyApp", false);
key.Close();
}
I've build one executable file (MyApp.exe) and installed on my computer. But the application still does not run when Windows start up. How can I do? how to change Startup impact "not measured" to other on Task Manager?
I'm using Windows 10 x64. Sorry for my English.
Thanks.