- Aug
- 2,010
- 81
I was looking for a way to open, from the command line, Windows 10 UWP apps.
I am referring to Windows 10 UWP apps that are downloaded from the store.
While the source code for most of the Microsoft Windows 10 UWP apps can be downloaded and compiled on my system, creating an .EXE to run the UWP apps, I want to run the app as installed from the Windows Store.
I've created a test .btm, which allows the selection of a few UWP apps, and then executes the UWP app from the command line.
Reference the Microsoft Document Launch an app with a URI for details.
Joe
I am referring to Windows 10 UWP apps that are downloaded from the store.
While the source code for most of the Microsoft Windows 10 UWP apps can be downloaded and compiled on my system, creating an .EXE to run the UWP apps, I want to run the app as installed from the Windows Store.
I've created a test .btm, which allows the selection of a few UWP apps, and then executes the UWP app from the command line.
Reference the Microsoft Document Launch an app with a URI for details.
Joe
Code:
@setlocal
@echo off
::
:: Open UWP apps from the command line on Windows 10
::
:: URI - Uniform Resource Identifier
:: UWP - Universal Windows Platform
::
text > clip:
Alarm_Clocks
Calculator
Edge
Mail_To
Maps
Store
Terminal
To_Do's
Twitter
Weather
Get-AppxPackage
endtext
set results=%@select[clip:,1,1,20,80,Select a file from the list]
switch %results
case Alarm_Clocks
start ms-clock:
::explorer.exe shell:AppsFolder\Microsoft.WindowsAlarms_8wekyb3d8bbwe!App
case Calculator
start ms-calculator:
::explorer.exe shell:AppsFolder\Microsoft.WindowsCalculator_8wekyb3d8bbwe!App
case Edge
start microsoft-edge:
case Mail_To
start mailto:
case Maps
explorer.exe shell:AppsFolder\Microsoft.WindowsMaps_8wekyb3d8bbwe!App
case Store
start ms-windows-store:
case Terminal
explorer.exe shell:AppsFolder\Microsoft.WindowsTerminal_8wekyb3d8bbwe!App
case To_Do's
explorer.exe shell:AppsFolder\Microsoft.Todos_8wekyb3d8bbwe!App
case Twitter
start twitter:
case Weather
start bingweather:
case Get-AppxPackage
::
:: Gets a list of the Microsoft app packages that are installed in a user profile.
::
pshell /s "(Get-AppxPackage -Name Microsoft.*).PackageFamilyName" | *view
::
:: Ref. https://docs.microsoft.com/en-us/powershell/module/appx/get-appxpackage?view=win10-ps
::
default
echo No selection made.
endswitch
endlocal