I once saw a guy run a command and got a list of all installed applications on his computer. How do I do this?
I would like a list of my currently installed applications. I believe he used WSH somehow.
111 Answers
If you use Windows Vista or Windows 7 and you didn't want install additional software, you can:
- Open a command-line window (Windows + R, CMD.EXE)
- Type
wmic(Enter) - Type
product get name(Enter)
PsInfo from Microsoft/Sysinternals can list all the installed software if you use the -s flag when you run it. You can also use -c to output it as a csv file to use in Excel for example.
C:\> psinfo -s > software.txt
C:\> psinfo -s -c > software.csv 4 A PowerShell script to list them:
$loc = Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall
$names = $loc |foreach-object {Get-ItemProperty $_.PsPath}
foreach ($name in $names)
{ Write-Host $name.Displayname
}Not exactly command line, but for this purpose I personally use CCleaner's uninstall tool, and you can export the list of installed software to a text file:
Not exactly command line either, but trusty old SIW will do the job as well. Highlight Applications, right click → Export To → CSV, HTML, TXT or XML:
SIW is freeware and portable, and installation isn't required.
1To add to MicTech's solution - use wmic and capture the list of installed software to a file:
Open a command-line window (Windows + R, CMD.EXE)
wmic /OUTPUT:my_software.txt product get name 0 The CCleaner solution above seems like a decent way to go about it, unless you're determined to use the command-line. I've used CCleaner before, it's a good tool But don't assume that everything is registered in the Add/Remove Programs applet (the same list). There are plenty of apps that use xcopy-style installation, i.e. simply unzip this archive and run. Those will not show up in the list.
Sysinternals psinfo.exe provides the most complete information of all the suggestions given, and it can be run on any Windows PC from the command line directly from an elevated CMD prompt, without permanent downloading:
\\live.sysinternals.com\tools\psinfo.exe -s > %userprofile%\Desktop\_psinfo.txtYou will get a security prompt when you run this, and a EULA prompt the first time on a machine. A text file will be saved to the current desktop.
The EULA can be automatically accepted like this:
\\live.sysinternals.com\tools\psinfo.exe -s /accepteula > %userprofile%\Desktop\_psinfo.txt 0 I use powershell here:
Get-Package | Where-Object {$_.ProviderName -in @('Programs','msi','chocolatey')} | Select-Object * | Out-GridView "Installed programs" There is a portable application called Showmysoft. It will show the installed software on the local machine and remote machines and can export to PDF and to CSV. Installation is not required. Download from .
The minimum system requirement is Microsoft .NET Framework 2.0.
The encoded version in C# installed programs via Windows registry:
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace SoftwareInventory
{ class Program { static void Main(string[] args) { //!!!!! Must be launched with a domain administrator user!!!!! Console.ForegroundColor = ConsoleColor.Green; StringBuilder sbOutFile = new StringBuilder(); Console.WriteLine("DisplayName;IdentifyingNumber"); sbOutFile.AppendLine("Machine;DisplayName;Version"); // Retrieve machine name from the file :File_In/collectionMachines.txt //string[] lines = new string[] { "NameMachine" }; string[] lines = File.ReadAllLines(@"File_In/collectionMachines.txt"); foreach (var machine in lines) { // Retrieve the list of installed programs for each extrapolated machine name var registry_key = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"; using (Microsoft.Win32.RegistryKey key = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, machine).OpenSubKey(registry_key)) { foreach (string subkey_name in key.GetSubKeyNames()) { using (RegistryKey subkey = key.OpenSubKey(subkey_name)) { //Console.WriteLine(subkey.GetValue("DisplayName")); //Console.WriteLine(subkey.GetValue("IdentifyingNumber")); if (subkey.GetValue("DisplayName") != null) { Console.WriteLine(string.Format("{0};{1};{2}", machine, subkey.GetValue("DisplayName"), subkey.GetValue("Version"))); sbOutFile.AppendLine(string.Format("{0};{1};{2}", machine, subkey.GetValue("DisplayName"), subkey.GetValue("Version"))); } } } } } // CSV file creation var fileOutName = string.Format(@"File_Out\{0}_{1}.csv", "Software_Inventory", DateTime.Now.ToString("yyyy_MM_dd_HH_mmssfff")); using (var file = new System.IO.StreamWriter(fileOutName)) { file.WriteLine(sbOutFile.ToString()); } // Press Enter to continue Console.WriteLine("Press enter to continue!"); Console.ReadLine(); } }
} Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, Size, InstallDate | Format-Table -AutoSizeIt worked for me. source -