I would like to be able to launch a Windows 10 UWP app from a single command line (cmd Windows 10) input. I am having issues concatenating the strings together to form the entire package name (this needs to be dynamic because the ending string of the app can change with each deployment). Here is the logic I have:
I have gotten to a point where I can find #1, but for some reason when I try to append it to #2, I get a NULL value. Here is my current command:
1.) & 2.): Get Package Name and Append it to "!App"
set "x=|dir %LocalAppData%\Packages /b | findstr packageName" & set "y=!App" & set "z=%x%%y%" & echo.%z%
3.): Launch UWP App
explorer.exe shell:appsFolder\packageName_postfix!App
Any ideas?
First you must know this solution only work on Windows 10 Fall Creators Update and newer versions. This API will support Windows Insider Build version 16266 or greater.
Add this namespace in Pacakge.appxmanifest file :
xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"
Then add this extension :
<Extensions>
<uap5:Extension
Category="windows.appExecutionAlias"
Executable="MyApp.exe"
EntryPoint="MyApp.App">
<uap5:AppExecutionAlias>
<uap5:ExecutionAlias Alias="MyApp.exe" />
</uap5:AppExecutionAlias>
</uap5:Extension>
</Extensions>
Build the application and run it one time!
Open command Prompt, type the alias name -> Enter
You can also see the reference Here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With