none
How can I make my app start when windows starts? RRS feed

  • Question

  • Hi, 

    I have a Windows Forms App (.NET Framework), a Windows Desktop application. I use the "Windows Application Packaging Project" to create an .appxbundle file which I can upload to the windows store. 

    When I test to install the .appxbundle locally, the installation works fine. 

    But when I start the installed application it fails to set the registry value SOFTWARE\Microsoft\Windows\CurrentVersion\Run\my_app

    It seem to be the app has not the right execution level, but even if I start the app with "Run as administrator" it fails. 

    The same app runs fine and set the registry value fine when run from visual studio.

    Monday, May 20, 2019 12:12 AM

All replies

  • Hi Jon76,

    >How can I make my app start when windows starts? 

    Here are two ways you can change which apps will automatically run at startup in Windows 10:
    1.Select the Start button, then select Settings  > Apps > Startup. Make sure any app you want to run at startup is turned On.
    2.If you don’t see the Startup option in Settings, right-click the Start  button, select Task Manager, then select the Startup tab. (If you don’t see the Startup tab, select More details.) Select the app you want to change, then select Enable to run it at startup or Disable so it doesn’t run. Watch the video to see how to do it. (Derive from Change which apps run automatically at startup in Windows 10)

    If I misunderstand your meaning, please point out and tell me more about the following questions

    >But when I start the installed application it fails to set the registry value....

    Did you install it from Microsoft Store?Was this app installed successfully? Could you show more error details for us to analyze?

    Best regards

    Daisy  Tian


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 20, 2019 2:55 AM
    Moderator
  • Hi Daisy,

    I forgot to clarify I have developed the application myself. 

    I have the following code:

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

    rk.SetValue(appName, Application.ExecutablePath + " /m");

    This works fine if I run my application from Visual Studio. But after installation it does not work.

    Monday, May 20, 2019 9:32 AM
  • My app is not in the Start-up list you mention either.

    No, I didnt install it from Microsoft Store, I use the "Windows Application Packaging Project" to create an .appxbundle file which I can upload to the windows store. When I test to install the .appxbundle locally, the installation works fine. 

    But when I start the installed application it fails to set the registry value SOFTWARE\Microsoft\Windows\CurrentVersion\Run\my_app

    The same app runs fine and set the registry value fine when run from visual studio.

    Monday, May 20, 2019 1:44 PM