0

I can see the app in registers but it wont startup.

RegistryKey rkApp = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); // Add the value in the registry so that the application runs at startup 
rkApp.SetValue("WindowsSelfRepairTool", System.Reflection.Assembly.GetEntryAssembly().Location);

This is the code I copied from internet, it gets my application to registers because I can see it "On startup" in task manager as well as in the registry editor. But for some reason, when I restart the computer the app wont start. Also I tried this code in Console App and added code Process.Launch("..") to launch the WPF one. Console starts successfuly but it doesnt run the WPF.. Any help?

Luuk
  • 12,245
  • 5
  • 22
  • 33
  • 1
    Possible cause: [Launch wpf Application on Windows startup](https://stackoverflow.com/a/21348394/724039), – Luuk Dec 30 '22 at 12:29
  • My first suggestion would be to check and make sure that the path in the registry is set correctly. Not sure but `Location` might be just the path without the file name? – noel Dec 30 '22 at 12:30
  • When the value `Location` contains, one or more, spaces, you might need to add double quotes around the value. – Luuk Dec 30 '22 at 12:46

0 Answers0