17

All is in the title, I currently searching a way to launch my UWP app automatically at Windows startup with the UWP framework only, no file manipulation on the machine. The application must be able to be shared on the Store AND open when Windows starts.

Is it a feasible thing? If so how?

Thank you!

scbj
  • 225
  • 1
  • 2
  • 12

6 Answers6

15

It seems that MS will add this feature - windows.startupTask - not only for converted desktop apps, but also UWP apps.

You can see it from about 37:00 Tip, tricks, and secrets: Building a great UWP app for PC

But this feature is not ready yet - It'll be available with Windows 10 Fall Creators Update.(I've tried with SDK 16225 but not ready yet)

Added 12/18/2017 - You can do it with Win10 Fall Creators Update.Following post show the details.

Configure your app to start at log-in (Windows Blog)

One consideration point is: By the feature, you can just 'start' the app - the app window is not shown. To see the app window, the user should click the app task at the task bar. It's a slightly ridiculous implementation for me. From the view of customer, 'click to start' and 'click to activate' is same behavior. You can do the some task in background before the user activate the app, but this is an another story.

Mamoru Satoh
  • 2,670
  • 23
  • 23
14

@hsmiths wrote easist solution to start app automatically and I'd like to summarize in step by step.

  1. Open File Explorer
  2. In address bar, copy-and-paste shell:AppsFolder
  3. Right-click the app and then click Create Shorcut.
  4. The message box asks to create shorcut on the Desktop. Click Yes.
  5. In File Explorer address bar, copy-and-paste shell:startup
  6. Go to Desktop and copy-and-paste shorcut to File Explorer.
  7. Reboot your computer if you want to test.

+Tip: if you want to by-pass login dialog on Windows startup.

  1. Start > Run
  2. type control userpasswords2
  3. User Accounts window will be opened. Uncheck Users must enter a user name ...
  4. When you click OK, you will be asked to enter account password. Type password.
  5. Reboot your computer if you want to test.
Youngjae
  • 24,352
  • 18
  • 113
  • 198
11

If it's a desktop application converted to UWP you can declare a startup task in your appmanifest like this:

<desktop:Extension Category="windows.startupTask" Executable="bin\MyStartupTask.exe"
EntryPoint="Windows.FullTrustApplication">
    <desktop:StartupTask TaskId="MyStartupTask" Enabled="true" DisplayName="My App Service" />
</desktop:Extension>

See Converted desktop app extensions

KyleUp
  • 1,683
  • 1
  • 13
  • 17
  • 1
    For information, it doesn't work for me because the Executable name wasn't found by the packager during compilation, i just removed the entry Executable=".." and it works fine now. – jcq May 14 '20 at 13:20
4

You can on Windows 10 (I'm not sure about Windows 8 or earlier versions), here's the instructions from Microsoft: https://learn.microsoft.com/en-us/windows/uwp/launch-resume/create-and-register-a-background-task

Even in Windows 10 IoT you can set an app to autostart through a PS command:

[192.168.0.243]: PS C:\> iotstartup list MyBackgroundApp
Robert Corvus
  • 2,054
  • 23
  • 30
2

You can create a .bat script that execute "start AppID!App" "AppID!App" string is available in shell:AppsFolder view, you have to add the given column.

Then place the .bat file in the startup folder:

  • "shell:startup" for the given user,
  • "c:\windows\system32\GroupPolicy\User\Scripts\Logon" for all the users of the given computer
Danh
  • 96
  • 4
  • 1
    in the shell:AppsFolder view you can right-click and "create shortcut". Drag the resulting shortcut to the shell:Startup folder – hsmiths Aug 06 '16 at 20:33
1

I think that is not possible, but maybe you can use a trigger in order to activating a background task when something happen.. Here's a list of the available triggers:

  • SystemTrigger
  • MaintenanceTrigger
  • TimeTrigger
  • PushNotificationTrigger
  • NetworkOperatorNotificationTrigger
  • NetworkOperatorHotspotAuthenticationTrigger

However you have some constraint.. take a look here: http://blogs.msdn.com/b/windowsappdev/archive/2012/05/24/being-productive-in-the-background-background-tasks.aspx

Mirko Bellabarba
  • 562
  • 2
  • 13
  • 2
    This is a good way but i finally turn to a WPF application. Thanks! – scbj Mar 18 '16 at 13:54
  • You're welcome! I think wpf is the best solution for this scenario – Mirko Bellabarba Mar 18 '16 at 14:16
  • There's an answer involving the following steps, which seems more straightforward than this: Open File Explorer 1. In address bar, copy-and-paste shell:AppsFolder 2. Right-click and then click Create Shorcut. 3. The message box asks to create shorcut on the Desktop. Click Yes. 4. In File Explorer address bar, copy-and-paste shell:startup 5. Go to Desktop and copy-and-paste shorcut to File Explorer. 6. Reboot your computer if you want to test. – Søren Spelling Lund Nov 17 '16 at 10:18
  • 1
    @SørenSpellingLund I think he was looking for a programmatic solution.. – Mirko Bellabarba Nov 17 '16 at 14:16