Search code examples
registry

Getting Installed softwares name and version using "Reg Query"


can anyone please help me to find out the display name and version of all installed softwares of a machine by using "Reg Query"?

if we use "/s" option with "reg query" then we will get all subkeys and value names recursively, but i need only display name and display version of each and every software. .


Solution

  • exceute the below command "REG QUERY HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall /s"

    split the output of above command using "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\" to get the array of strings. Now parse the each string for software display name and version.

    Regular expressions for getting displayname and version are:

    Displayname: "(.*)" + "DisplayName" + @"\s+REG_SZ\s+(.*)\s"

    Displayversion: "(.*)" + "DisplayVersion" + @"\s+REG_SZ\s+(.*)\s"