How can you launch a windows 10 app from command line?

Elsewhere on the internet, there is advice that the 'best' way to launch a "Windows 10 app" aka UWP app is via a new explorer.exe process, using the 'shell:' protocol, (If it hasn't registered it's own protocol)

param([string]$AppName) $Path="shell:appsfolder\"+(Get-AppXPackage | where{$_.Name -match "$AppName"} | select -expandproperty packagefamilyname)+"!App" return $Path 

however, calling this script results in

PS C:\Users\RyanLeach\Documents\WindowsPowerShell\Scripts> $ShareX = ./findapp.ps1 ShareX PS C:\Users\RyanLeach\Documents\WindowsPowerShell\Scripts> $ShareX shell:appsfolder\19568ShareX.ShareX_egrzcvs15399j!App PS C:\Users\RyanLeach\Documents\WindowsPowerShell\Scripts> Start-Process -FilePath $ShareX Start-Process : This command cannot be run due to the error: The system cannot find the file specified. At line:1 char:1 + Start-Process -FilePath $ShareX + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand 

So how can you launch a Store app (Desktop or UWP) via command-line / PowerShell, passing arguments?

2

1 Answer

Try:

Start-Process -FilePath "explorer.exe" "shell:appsFolder\19568ShareX.ShareX_egrzcvs15399j!App" 
5

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like