You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何获取Windows完整应用列表?shell:AppsFolder读取问题求解

获取Windows完整应用程序列表的解决方案

问题背景

使用以下PowerShell命令获取应用列表时,会缺失Steam等部分应用:

Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize

同时无法通过Get-ChildItem查看虚拟文件夹shell:AppsFolder的内容,需要完整获取系统内的所有应用。

解决方案

1. 扩展注册表查询范围

原命令仅查询了32位程序在64位系统中的注册表路径,需补充查询HKLM下的64位程序路径和当前用户(HKCU)的安装路径,这些路径下会包含原命令遗漏的应用:

# 合并三个路径的查询结果,去重并过滤空DisplayName
$uninstallPaths = @(
    'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*',
    'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
    'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*'
)

Get-ItemProperty $uninstallPaths | 
    Where-Object { $_.DisplayName -ne $null } |
    Select-Object DisplayName, DisplayVersion, Publisher, InstallDate |
    Sort-Object DisplayName |
    Format-Table -AutoSize

该命令会覆盖系统级和用户级安装的桌面应用,Steam这类用户级安装的应用会被包含在内。

2. 访问shell:AppsFolder虚拟文件夹

shell:AppsFolder是Windows统一管理所有应用(包括UWP、桌面应用、快捷方式)的虚拟容器,需通过COM对象访问,而非常规文件系统命令:

# 创建Shell应用对象,访问AppsFolder
$shell = New-Object -ComObject Shell.Application
$appsFolder = $shell.Namespace('shell:AppsFolder')

# 遍历所有应用项,提取关键信息
$appsFolder.Items() | ForEach-Object {
    [PSCustomObject]@{
        DisplayName = $_.Name
        AppID       = $_.Path
        Publisher   = $appsFolder.GetDetailsOf($_, 13) # 13对应发布者字段
        InstallDate = $appsFolder.GetDetailsOf($_, 12) # 12对应安装日期字段
    }
} | Where-Object { $_.DisplayName -ne $null } | Sort-Object DisplayName

此方法能获取系统中所有可被启动的应用,包括UWP应用和部分仅在开始菜单显示的快捷方式。

3. 使用Get-StartApps命令快速获取开始菜单应用

如果仅需要获取开始菜单中的应用列表,可直接使用内置命令:

Get-StartApps | Sort-Object Name

该命令返回的结果包含应用名称和AppID,适合快速查看常用应用。

内容的提问来源于stack exchange,提问作者S.Maier

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.15 16:21:11