This blog explains how we can launch an MSIX application from the command line.
First, we need to get the name of the MSIX application shortcut that we want to launch from the command line, and retrieve its associated AppID. We can do this easily by opening a Powershell.exe console and running:
get-startapps
We can then filter on the specific application we’re interested in using the -Name
parameter like so:
get-startapps -Name "VLC media player"
Once we have the name of the application, we need to retrieve the AppID like so:
get-startapps -Name "VLC media player" | Select -ExpandProperty AppID
And now we have the AppID, we can launch it from a PowerShell session like so:
Start-Process -FilePath shell:AppsFolder\$(get-startapps -Name "VLC media player" | Select -ExpandProperty AppID)
And of course, if we want to launch it from a non-PowerShell session (perhaps a command prompt) we can launch it like so:
powershell.exe -Command "Start-Process -FilePath shell:AppsFolder\$(get-startapps -Name 'VLC media player' | Select -ExpandProperty AppID)"
Alternatively, if we weren’t fussed about launching the application dynamically, we could just retrieve the static command line like so:
write-host "explorer.exe shell:AppsFolder\$(get-startapps -Name "VLC media player" | Select -ExpandProperty AppID)"
Which would result in something similar to this:
explorer.exe shell:AppsFolder\VLC3.0.18_c9pt9p6bt4qgy!VLC
Or alternatively, just get them all and manually find the right application!!
cls
foreach ($app in get-startapps) {
$appName = $app.Name
$appID = $app.AppID
write-host "Shortcut Name: $appName"
write-host "Shortcut Path: explorer.exe shell:AppsFolder\$appID"
write-host ""
}
And that’s it! Happy MSIX launching!