如何获取微软商店应用安装路径?以AutoHotkey调用Trello为例
Got it, let's sort this out—Microsoft Store apps are tucked away in a protected, hidden folder that's a pain to navigate directly, but there are a few easy ways to get what you need for your AutoHotkey hotkey.
Method 1: Use PowerShell to Get the Install Path
This is the most reliable way to pull the exact install location:
- Open PowerShell (press Win+X, then select "Windows PowerShell" or "Windows Terminal" if you have it).
- Run this command:
Get-AppxPackage *Trello* - Look for the InstallLocation line in the output—it'll show you the full path to Trello's folder. For example, it might look like
C:\Program Files\WindowsApps\Trello.SomeRandomID_1.2.3.0_x64__abc123. - Navigate to that folder, and you'll find the
trello.exe(or similar executable) you need for your AutoHotkey script.
Method 2: Launch Trello Directly Without the Path (Even Easier!)
You don't actually need the full executable path—AutoHotkey can launch Microsoft Store apps using their unique app ID, which avoids issues if the path ever changes after an update. Here's how:
- First, get Trello's package family name with this PowerShell command:
Get-AppxPackage *Trello* | Select-Object PackageFamilyName, PackageFullName - Copy the
PackageFamilyNamevalue (it'll look likeTrello.xxxxxx_abc123). - Use this format in your AutoHotkey script:
Replace#t::Run, explorer.exe shell:appsFolder\<YourPackageFamilyName>!App<YourPackageFamilyName>with the value you copied. For example:
This will launch Trello directly without needing to hunt for the exe path.#t::Run, explorer.exe shell:appsFolder\Trello.Desktop_b1g8s10c5jhyk!App
Method 3: Grab the Path from Task Manager (When Trello is Running)
If Trello is already open, this is quick:
- Open Task Manager (Ctrl+Shift+Esc).
- Find the Trello process under the "Processes" tab.
- Right-click the process, then select "Open file location".
- This will take you straight to the folder containing Trello's executable—just copy that path for your script.
A quick note: The C:\Program Files\WindowsApps folder (where Microsoft Store apps live) is hidden and requires admin permissions to access directly, so using the methods above is way simpler and safer than trying to navigate there manually.
内容的提问来源于stack exchange,提问作者TheKidsWantDjent

