How to make an exe start at the Windows Startup [duplicate] How to make an exe start at the Windows Startup [duplicate] windows windows

How to make an exe start at the Windows Startup [duplicate]


Add to shortcut to Windows start-up folder:

Environment.GetFolderPath(Environment.SpecialFolder.Startup)

Or add to registry, something like this:

RegistryKey add = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);add.SetValue("Your App Name", "\"" + Application.ExecutablePath.ToString() + "\"");

You can change CurrentUser to LocalMachine if you want it to run with every user. Thanks to Aidiakapi.


This can be done using the windows registry. I recomend you to check this registry keys.

HKLM\Software\Microsoft\Windows\CurrentVersion\RunHKLM\Software\Microsoft\Windows\CurrentVersion\RunOnceHKLM\Software\Microsoft\Windows\CurrentVersion\RunServicesHKLM\Software\Microsoft\Windows\CurrentVersion\RunServicesOnceHKCU\Software\Microsoft\Windows\CurrentVersion\RunHKCU\Software\Microsoft\Windows\CurrentVersion\RunOnceHKCU\Software\Microsoft\Windows\CurrentVersion\RunOnceEx 


You could add your application to the registry to run on startup at

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
or
HKEY_CURREN_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

or you could add it to the startup folder for the system.

These are probably the most common/easiest options if you do not want to write a service.