Get list of installed applications from Windows command line

34

21

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.

rana

Posted 2009-11-10T19:05:44.060

Reputation:

Related: Is there a utility that will give me a list of all programs installed dumped to a text file for Windows?  (not restricted to command line solutions).

– G-Man Says 'Reinstate Monica' – 2015-12-07T05:08:02.897

Answers

40

If you use Windows Vista or Windows 7 and you didn't want install additional software, you can:

  1. Open a command-line window (Windows + R, CMD.EXE)
  2. Type wmic (Enter)
  3. Type product get name (Enter)

MicTech

Posted 2009-11-10T19:05:44.060

Reputation: 9 888

1@MiserableVariable Does it say that? (Is it the wrong link?) How would one query the uninstall registry in similar fashion? (or perhaps by using wmic itself?) – JeromeJ – 2016-03-08T22:59:56.067

1Also works with Windows 10 – Turcia – 2016-08-03T07:33:58.483

+1 On Windows Server 2012R2,>wmic product get name, version > programs.txt doens't get everything listed in Add/Remove Programs, but gets most items, better than listing it all yourself, that's for sure. – Chad Cooper – 2016-08-20T14:31:07.603

5Is it just me, or this runs very slow? – user3083324 – 2016-11-20T00:56:09.593

@MicTech: what about the size parameter? I'm getting Description = invalid query, and using this command: wmic:root\cli>/output:C:\ProgramList.txt product get name, version, InstalledDate, size. The problem is with size parameter – el.severo – 2017-04-15T11:14:48.053

5here it says that Win32_Product will not give all the information about the installed softwares. That means, it will not list all the softwares. The reason for this is, win32_product queries the MSI database to get the list. But there will be many softwares which will not have a entry in it as they got installed from exe's. In this case querying the uninstall registry key gives information about these softwares. – Miserable Variable – 2012-06-25T18:40:45.687

+1 There's not much about your machine that WMI can't tell you these days. – GAThrawn – 2009-11-10T20:15:06.407

Didn't know about this +1 – Unfundednut – 2009-11-10T20:39:26.997

Classy and useful – Guy Thomas – 2009-11-10T21:11:27.133

27

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

djhowell

Posted 2009-11-10T19:05:44.060

Reputation: 3 535

Does not show all installed software on Windows 2012 R2 x64. I'm using PsInfo ver. 1.77 – Tomasito – 2016-05-11T19:33:40.217

This method produced 933 items on my laptop and the WMI method produced only 598. It seemed to produce a larger list... – Andrej Adamenko – 2017-02-09T13:00:22.497

@djhowell: I am trying to execute the command in Windows 7 but I get an error, " psinfo is not recognized as an internal or external command, operable program or batch file. ". And this happens even in elevated rights cmd window. – skm – 2018-04-18T11:50:22.863

1also works unter Win XP in contrast to WMI solution – Gerd Klima – 2009-11-10T20:56:39.240

14

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:

Alt text

John T

Posted 2009-11-10T19:05:44.060

Reputation: 149 037

2Rather ironic that the Windows Powershell etc tools take ages to run (>5 mins) but CCleaner is instant. – CAD bloke – 2015-08-03T10:12:32.663

6

Not exactly command line either, but trusty old SIW will do the job as well. Highlight Applications, right click → Export ToCSV, HTML, TXT or XML:

Alt text

SIW is freeware and portable, and installation isn't required.

Molly7244

Posted 2009-11-10T19:05:44.060

Reputation:

I have always know SIW to require a license, where are you getting it as Freeware? – El Turner – 2016-06-10T18:51:21.233

3

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.

JMD

Posted 2009-11-10T19:05:44.060

Reputation: 4 427

3

To 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

Moots

Posted 2009-11-10T19:05:44.060

Reputation: 31

2

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.txt

You 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

Matthew Simpson

Posted 2009-11-10T19:05:44.060

Reputation: 21

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();
        }
    }
}

Domenico Zinzi

Posted 2009-11-10T19:05:44.060

Reputation: 171

0

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 http://spidersoft.in/showmysoft/.

The minimum system requirement is Microsoft .NET Framework 2.0.

jacob justin

Posted 2009-11-10T19:05:44.060

Reputation: 19