Fire up your console and type:
wmic product get name,version
It takes a while, but you'll get the full list of installed programs. WMIC is the console version of Windows Management Instrumentation, available from Windows 2000 and onwards. Following the instructions here and here, you can tell WMIC to output in an XML format, that might be a bit more convenient for you. However just calling wmic product get name will get you a list of application names, that you can easily copy paste to a text editor and convert to spreadsheet format.
Alternatively, enter:
wmic /output:C:\InstallList.txt product get name,version
This will output a TXT file with the list of programs. You can then paste that into a spreadsheet, if you want.
Source: http://helpdeskgeek.com/how-to/generate-a-list-of-installed-programs-in-windows/
Also you can use the csv.xsl file to format the output into a CSV list of results:
wmic /output:C:\InstallList.csv product get /format:csv.xsl
or the htable.xsl file to create an HTML table of results:
wmic /output:C:\InstallList.htm product get /format:hform.xsl
Answer from yannis on Stack ExchangeFire up your console and type:
wmic product get name,version
It takes a while, but you'll get the full list of installed programs. WMIC is the console version of Windows Management Instrumentation, available from Windows 2000 and onwards. Following the instructions here and here, you can tell WMIC to output in an XML format, that might be a bit more convenient for you. However just calling wmic product get name will get you a list of application names, that you can easily copy paste to a text editor and convert to spreadsheet format.
Alternatively, enter:
wmic /output:C:\InstallList.txt product get name,version
This will output a TXT file with the list of programs. You can then paste that into a spreadsheet, if you want.
Source: http://helpdeskgeek.com/how-to/generate-a-list-of-installed-programs-in-windows/
Also you can use the csv.xsl file to format the output into a CSV list of results:
wmic /output:C:\InstallList.csv product get /format:csv.xsl
or the htable.xsl file to create an HTML table of results:
wmic /output:C:\InstallList.htm product get /format:hform.xsl
Run wmic product get to get a list of installed software, it should be exactly the same list as add/remove programs.
You can supposedly get it to to output in a specific format, but I haven't tried it.
(Use wmic product get /? to see the parameters including the output formatting, I tried to include it here but the formatting wasn't quite right.)
Show all programs using wmic command - Software & Applications - Spiceworks Community
windows - WMI: Get the list of Installed Softwares - Stack Overflow
Search WMIC for installed software - AutoIt General Help and Support - AutoIt Forums
View installed software version via command line?
It depends on the author of the program to provide an interface to get the version of the program. If it's not available, there is no "common" way. It will likely need to be done on a per program basis.
More on reddit.comVideos
My output is empty / blank, see belwo.
The example is missing the trailing slash after Uninstall. I get different software lists when I look at the 32/64 bit entries.
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | sort-object -property DisplayName | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize
Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | sort-object -property DisplayName | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize
For a combined view, run this.
function Analyze(
f) {
Get-ItemProperty $p |foreach {
if (($_.DisplayName) -or ($_.version)) {
[PSCustomObject]@{
From = $f;
Name = $_.DisplayName;
Version = $_.DisplayVersion;
Install = $_.InstallDate
}
}
}
}
s += Analyze 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' 64
$s += Analyze 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' 32
$s | Sort-Object -Property Name
Instead of WMIC, try Get-CimInstance
Get-CimInstance Win32_Product | Sort-Object -property Name | Format-Table -Property Version, InstallDate, Name
One behavior I have noticed is that referencing Win32_Product generates an event for each product in the application event log. Check your log. You might be getting an error that is stopping the analysis.
Log Name: Application
Source: MsiInstaller
Date: 2/2/2021 10:06:39 AM
Event ID: 1035
Task Category: None
Level: Information
Keywords: Classic
User: SYSTEM
Computer: slick
Description:
Windows Installer reconfigured the product. Product Name: Microsoft SQL Server 2014 Management Objects. Product Version: 12.0.2000.8. Product Language: 1033. Manufacturer: Microsoft Corporation. Reconfiguration success or error status: 0.
Hi,
My output is empty / blank, see belwo.
The WMI class Win32_Product uses the MSI provider to collect installed program data. This means you're only going to get data on software/packages installed using MSI. Further, calling this class causes a repair action to be executed on every program it returns. Most of the time this isn't an issue, but it will fill up the event log and can cause issues for some software. You can get more detail on this link: Win32_Product Class
Most scripters, coders, etc use one of two things; 1) Registry Query, 2) WMI query of the SCCM class SMS_InstalledSoftware. Obviously the SCCM class requires SCCM to be installed on the host. You can read more about that HERE. So that really only leaves the registry query for most folx. Don't fret though, because all the work was already done for you by TSG.
Your pot of gold is "Use PowerShell to Quickly Find Installed Software"
While I'd do things slightly differently than in that post, it has all the heavy lifting already written. With a little aptitude and some google searching you can customize as you wish.
I'm not sure if you're intentionally ignoring 64-bit software, but keep in mind that the SOFTWARE\Wow6432Node is only supposed to be for 32 bit software running on a 64 bit machine. You also have HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
If you want all software, you'll need to aggregate a few methods/sources. Those two keys should have most, if not all. You must also consider HKEY_USERS[each user]\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ and its Wow6432Node counterpart. Applications like DropBox, sometimes google chrome, and a few others are installed only in the user environment. I suspect this is also why the Win32_Product does not have those specific packages.
For filtering your aggregated list, there isn't a simple way. You could exclude those with the key System=1 or Publisher="Microsoft Corporation" (double check the key name; I may have remembered wrong). Those keys are used in some non-essential software too, though.
You can use wmic.
Example:
wmic product get name,version /format:csv
wmic /node:localhost /output:d:\programlist.htm product
get name,version /format:htable.xsl
wmic product get name,version
wmic softwareelement get name,version
wmic softwarefeature get name,version
wmic wmic:root\cli>/output:c:\ProgramList.txt product get name,version
Or you can do it like the "Add/Remove Programs", reading all uninstall registry keys:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall
On 64 bit Windows, remember to also check:
HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\
To returns a list of all software installed on a computer, whether or not by Windows-Installer:
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
strComputer = "."
strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
strEntry1a = "DisplayName"
strEntry1b = "QuietDisplayName"
strEntry2 = "InstallDate"
strEntry3 = "VersionMajor"
strEntry4 = "VersionMinor"
strEntry5 = "EstimatedSize"
Set objReg = GetObject("winmgmts://" & strComputer & _
"/root/default:StdRegProv")
objReg.EnumKey HKLM, strKey, arrSubkeys
WScript.Echo "Installed Applications" & VbCrLf
For Each strSubkey In arrSubkeys
intRet1 = objReg.GetStringValue(HKLM, strKey & strSubkey, _
strEntry1a, strValue1)
If intRet1 <> 0 Then
objReg.GetStringValue HKLM, strKey & strSubkey, _
strEntry1b, strValue1
End If
If strValue1 <> "" Then
WScript.Echo VbCrLf & "Display Name: " & strValue1
End If
objReg.GetStringValue HKLM, strKey & strSubkey, _
strEntry2, strValue2
If strValue2 <> "" Then
WScript.Echo "Install Date: " & strValue2
End If
objReg.GetDWORDValue HKLM, strKey & strSubkey, _
strEntry3, intValue3
objReg.GetDWORDValue HKLM, strKey & strSubkey, _
strEntry4, intValue4
If intValue3 <> "" Then
WScript.Echo "Version: " & intValue3 & "." & intValue4
End If
objReg.GetDWORDValue HKLM, strKey & strSubkey, _
strEntry5, intValue5
If intValue5 <> "" Then
WScript.Echo "Estimated Size: " & Round(intValue5/1024, 3) & " megabytes"
End If
Next
The encoded version in c# that is based on the readings in the system registry windows.
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();
}
}
}
From a Windows command line, I've used 'wmic get product name' but that only shows the software installed a certain way that wmic can recognize.
I also found this with Powershell.
Get-ItemProperty HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table -AutoSize
That shows other software and ones that are missing from wmic.
Some software has a log or text file with the version number that Find from a cmd line can read.
My goal is to pull the currently installed software version, like what you see from Windows Programs and Features, but from a command line ultimately, even if it's cheating a bit and using Powershell.
Is there something besides Find that might work to read off the .exe that runs the software to determine exactly which version it is?
I'm looking for something with a script that I can automate. Nothing with a gui. For Windows machines. Nothing with SCCM or Munki. I'm looking for the exact version number too, not just that the software is present. Otherwise DIR on c:\programs would work to some extent there.
I'm hoping there's some other way to read installed software besides Find or Findstr. Wmic and that Powershell line seem to work well enough. Simplifying it a little more is good.
Even with wmic and that Powershell line, it's grabbing a list of all of the software first, and then slimming it down with piping if I want to do that. It takes more time to grab all the software first. For wmic or PS, if there was a way to just ask for the individual piece of software instead of everything, that would be nice too, assuming that that's faster.
It depends on the author of the program to provide an interface to get the version of the program. If it's not available, there is no "common" way. It will likely need to be done on a per program basis.
https://docs.microsoft.com/en-us/sysinternals/downloads/psinfo
psinfo -s
Not sure if it will return all of the version numbers or just some of them.
Hi Dasaratha_penu,
There is no other native method in windows, but there is a free tiny utility named NirSoft UninstallView that does not need to be installed that will list all software installed on all drives and that will also allow you to select the whole list and copy it into another application
Download
https://www.nirsoft.net/utils/uninstallview-x64...
Homepage:
https://www.nirsoft.net/utils/uninstall_view.html
________________________________________________________
Standard Disclaimer: This is a non-Microsoft website. The page appears to be providing accurate, safe information. Watch out for ads on the site that may advertise products frequently classified as a PUP (Potentially Unwanted Products). Thoroughly research any product advertised on the site before you decide to download and install it.
.
Hi Dasaratha_penu,
I am Dave, I will help you with this.
The only command available that can list all software installed on the PC is the one below, but that creates a very long list of all software, including the pre-installed apps
wmic /output:"C:\Software List.txt" product get name,version