How to make autorun in C# when registry doesnt work

77 Views Asked by At

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?

0

There are 0 best solutions below