Search code examples
c#.netwindows.net-coreregistry

Run .net core app as windows application and start at windows startup


I have app wrote using .net core 2.2

I want to run it like windows application and start on windows startup.

Here is how I make it run as Windows app

enter image description here

How I can make it run at windows start?


Solution

  • You have multiple options here.

    1. One is to add a registry key. (you should have permission for this)

      RegistryKey registryKeyk = Registry.CurrentUser.OpenSubKey ("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);

      registryKeyk.SetValue("AppName", Application.ExecutablePath);

    2. You can run the exe from Task Scheduler.