Answer the question
In order to leave comments, you need to log in
How to register to run applications in the registry every time Windows boots through C#?
There is a piece of code. How to register to run applications in the registry every time you boot via C #? Exactly what needs to be added. I want to understand how viruses do it
static private void PicInvokeInfo()
{
Process proc = null;
try
{
ProcessStartInfo procInfo = new ProcessStartInfo("IExplorer.exe", "http://google.com");
proc = Process.Start(procInfo);
}
catch (Exception)
{
Console.WriteLine("Error");
}
}
Answer the question
In order to leave comments, you need to log in
It depends a little on the type of application. wpf? winforms? Console?
RegistryKey rkApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
rkApp.SetValue("My app's name", Application.ExecutablePath.ToString());
Environment.SpecialFolder.Startup
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question