Article View: alt.comp.os.windows-10
Article #129Re: How can we get an ACCURATE list of unique programs installed on WIndows?
From: Maria Sophia
Date: Sat, 10 Oct 2026 18:20
Date: Sat, 10 Oct 2026 18:20
117 lines
6783 bytes
6783 bytes
UPDATE: Removed usernames from the output
# ---------------------------------------------------------------------
# listapps.ps1
# ---------------------------------------------------------------------
# Reads the Windows Registry locations where installed programs often store
# their uninstall information. It checks 32-bit and 64-bit programs,
# installed for the current user.
#
# It also retrieves AppX packages for the current user using Get-AppxPackage.
#
# The script keeps registry entries with a display name, selects the name,
# version, and publisher, labels each entry by source, combines the results,
# sorts them alphabetically, and exports them to one desktop CSV file.
#
# To run: C:\> powershell -ExecutionPolicy Bypass -File listapps.ps1
# ---------------------------------------------------------------------
# v1p7 20261010 Converted C:\Users\whatever username to a tilde instead
# v1p6 20261010 Fixed syntax errors (-LiteralPath $_ and export pipe)
# v1p5 20261010 Stopped folder scans from digging deeply into sub-folders
# v1p4 20261010 Added scans for C:\app executables as per JJ's suggestion
# Added a 5th column (Path) to the CSV resulting in a row per
# folder listing: Name, Version, Publisher, Source and Path
# Note v1p3 runs much faster than v1p4 due to the exe scan.
# v1p3 20261010 Added to the CSV export a list of installed AppX packages
# v1p2 20261010 Added description of how it works into the comment block.
# v1p1 20261010 Output the list of installed apps to a desktop csv file
# v1p0 20261010 List installed programs to the powershell command line
# One row per folder Name, Version, Publisher and Source
# ---------------------------------------------------------------------
$paths = @(
'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*'
)
Write-Host "Gathering Registry applications..."
$registryApps = Get-ItemProperty $paths -ErrorAction SilentlyContinue |
Where-Object DisplayName |
Select-Object `
@{Name='Name'; Expression={$_.DisplayName}},
@{Name='Version'; Expression={$_.DisplayVersion}},
Publisher,
@{Name='Source'; Expression={'Registry'}},
@{Name='Path'; Expression={$_.InstallLocation}}
Write-Host "Gathering Store (AppX) applications..."
$storeApps = Get-AppxPackage |
Select-Object `
@{Name='Name'; Expression={$_.Name}},
@{Name='Version'; Expression={$_.Version.ToString()}},
Publisher,
@{Name='Source'; Expression={'AppX'}},
@{Name='Path'; Expression={$_.InstallLocation}}
$folderRoots = @(
'C:\app',
$env:ProgramFiles, ${env:ProgramFiles(x86)},
"$env:LOCALAPPDATA\Programs"
) |
Where-Object { $_ -and (Test-Path -LiteralPath $_) } |
Select-Object -Unique
Write-Host "Scanning custom and program folders (this may take a moment)..."
$folderApps = foreach ($root in $folderRoots) {
# Limit depth or filter out common noise directories to improve speed and accuracy
Get-ChildItem -LiteralPath $root -Directory -Recurse -Depth 3 -ErrorAction SilentlyContinue |
Where-Object {
$_.Name -notmatch '^(bin|core|_internal|cache|plugins|temp|shared|updates|lib|node_modules)$' -and $_.FullName -notmatch '\\(node_modules|cache|temp|logs|Localization)\\+'
} |
ForEach-Object {
$folder = $_
# Find a primary executable in the root of this folder (avoiding deep recursive grabs)
$exe = Get-ChildItem -LiteralPath $folder.FullName -File -Filter '*.exe' -ErrorAction SilentlyContinue |
Where-Object {
$_.Name -notmatch '^(unins|uninstall|setup|update|crash|helper|config|service|agent)'
} |
Select-Object -First 1
if ($exe) {
$info = $exe.VersionInfo
# Use ProductName if available, otherwise fallback to folder name
$appName = if ($info.ProductName -and $info.ProductName.Trim() -ne '') { $info.ProductName.Trim() } else { $folder.Name }
[PSCustomObject]@{
Name = $appName
Version = $info.ProductVersion
Publisher = $info.CompanyName
Source = 'FolderScan'
Path = $folder.FullName
}
}
}
}
# Clean up, anonymize username in paths, and deduplicate across all sources
$allApps = @($registryApps) + @($storeApps) + @($folderApps) |
Where-Object { $_.Name -and $_.Name -notmatch '^\d+(\.\d+)*$' } |
ForEach-Object {
# Replace the user profile folder path with '~'
if ($_.Path) {
$_.Path = $_.Path -replace [regex]::Escape($env:USERPROFILE), '~'
}
$_
} |
Sort-Object Name, Path -Unique
$outputCsv = "$HOME\Desktop\InstalledPrograms.csv"
$allApps | Export-Csv $outputCsv -NoTypeInformation
Write-Host "Done! Exported clean list to $outputCsv" -ForegroundColor Green
# end of listapps.ps1
Technical Details
Message-ID:
<11advlu$1fm7$1@nnrp.usenet.blueworldhosting.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED.public-nat-12.vpngate.v4.open.ad.jp!not-for-mailReferences:
<11abjg1$fb2$1@nnrp.usenet.blueworldhosting.com> <bj3qs8xw2mrd.1l1zhzw1pw1o7$.dlg@40tude.net> <11ad6mn$17o8$1@nnrp.usenet.blueworldhosting.com> <11adhdj$1pr6f$1@dont-email.me> <11ads7k$geq$1@nnrp.usenet.blueworldhosting.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED.public-nat-12.vpngate.v4.open.ad.jp!not-for-mail From: Maria Sophia <mariasophia@comprehension.com> Newsgroups: alt.comp.os.windows-10,alt.comp.os.windows-11,alt.msdos.batch Subject: Re: How can we get an ACCURATE list of unique programs installed on WIndows? Date: Sat, 10 Oct 2026 11:20:49 -0700 Organization: BWH Usenet Archive (https://usenet.blueworldhosting.com) Message-ID: <11advlu$1fm7$1@nnrp.usenet.blueworldhosting.com> References: <11abjg1$fb2$1@nnrp.usenet.blueworldhosting.com> <bj3qs8xw2mrd.1l1zhzw1pw1o7$.dlg@40tude.net> <11ad6mn$17o8$1@nnrp.usenet.blueworldhosting.com> <11adhdj$1pr6f$1@dont-email.me> <11ads7k$geq$1@nnrp.usenet.blueworldhosting.com> Reply-To: pusvul@getTjewytR4so+mqe2.invalid Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 10 Oct 2026 18:20:47 -0000 (UTC) Injection-Info: nnrp.usenet.blueworldhosting.com; posting-account="l//KxG3Ge2LojWvwJg0Igv8F0ChK8RUC9RtOxMPUo3U"; posting-host="Dg8vEhE1wZBDJOwXTSEKAoRS4PU2oXroEpl9dza6STY"; logging-data="48839"; mail-complaints-to="usenet@blueworldhosting.com" User-Agent: Mojibake 1p3 Cancel-Lock: sha1:McAQPBn6PidARxOTdcOT6RC6QCU= sha256:8f2yF1S6lubJk/Sx03qhLPZPumit04/3H3tpbLHx3ec= sha1:Af10NWwrjVNj7K1m8LSVpYo+B8E= sha256:IojinxRZ0qjMMHh7Ok6i2UH4hT8nvVWkeVqFOVZc+pA= Content-Language: en-GB