Question Locked

Command to list installed program/application name and its version.

0 helpful
16 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi there,
I hope someone can help me....
I have to collect OS name/ OS version and installed program(application)/its version from 60 personnel's PC.
I'm a real beginner in this industory but trying to learn...

What I found so far is

From Command Prompt,
reg export HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall temp1.txt

Then I can get program names and versions but at the same time, too much info gets displayed as well.
I only need application name and version.
I could delete by hand on Excel but it will take ages to do for 60 PCs....

Also, for OS name and version,
I found a command to display the window by
"WINMSD" command.

But I can't think of better way to get all necessary info in line.
I'm not familier with Batch program but I will learn it if I can get some tips!!

My task here is...
Get 60 personnel's PC info including OS/OS version/Application name/Application version.
(Surely, Application name and version have to link each other)

The PC is mostly Windows.
6 MAC PCs there too but in worst case, I could collect MAC info by hand.

I'd really really appreciate your big help!!

Nikki

16 replies

by scott_heath

I could write you a really complicated script, but I'm not going to. You can Google WMI software inventory and find lots of good stuff. You can visit my sad little blog and download my hardware inventory to collect software. using MSDN and a little reading it wouldn't be hard.

If you really want to use someone else's tool try this:

http://www.robvanderwoude.com/software.php

Regards,
Scott

http://scottisageek.spaces.live.com

by rob miners

Batch file:

@echo off

wmic /output:C:\%computername%.txt product get name,version

WMIC OS get name,version >> C:\%computername%.txt

Output is in this format:

Name                              Version     
Dawn Of War - Winter Assault      1.4         
Windows 7 Upgrade Advisor         2.0.3001.0  
Microsoft .NET Framework 3.5 SP1  3.5.30729   
Dawn Of War                       1.40        
Acrobat.com                       0.0.0       
PrimoPDF Redistribution Package   1.0.0.0     
Debugging Tools for Windows       6.8.4.0     
Adobe Reader 9                    9.0.0       
Name                                                                          Version   
Microsoft? Windows Vista? Business |C:\Windows|\Device\Harddisk0\Partition1  6.0.6002  

Type wmic /? for more help

Edit: posted the commands and output from an older version.

by rob miners

add the workstation name after /node:

I had to run this command on each workstation to get access: netsh firewall set service RemoteAdmin enable

Batch File:

WMIC /node:W7 OS get name,version > C:\W7.txt

WMIC /node:W7 product get name,version >> C:\W7.txt

Let us know how you get on.

by rob miners

that there was no AV showing in the output. Further investigation, and it doesn't pick up on older programs as well. Might not be what you are after.

by nikki_j

I tried the Batch but it didn't work.
Do I have to add something to it???

by nikki_j

My workmate managed to extract "DisplayName" and "DisplayVersion" from registry editor but the display order is not standardized so I can't tell which name matches to which version.
(I mean,some applications list "DisplayName" then "DisplayVersion", but some does in the other way around.) Also, some dont have Version info.

Maybe no other way to get the info wihtout using a software....? :( :<

by rob miners

at the end of the batch file and run it. In the command window, right mouse click and Select All, then press Enter. You will be able to paste the output into Notepad and save it. Post the contents of the output for us to have a look at.

by nikki_j

Thank you for your advice Scott, Seanferd and Jacky.
I will try the batch 1st now.
At the momemnt, I'm not allowed to use free software on everyone's PC.
I'll post again the result....

by nikki_j

My workmate managed to extract "DisplayName" and "DisplayVersion" from registry editor but the display order is not standardized so I can't tell which name matches to which version.
(I mean,some applications list "DisplayName" then "DisplayVersion", but some does in the other way around.) Also, some dont have Version info.

Maybe no other way to get the info wihtout using a software....? :<

by scott_heath

You could write the vbscript (or .Net, Java, etc) yourself to handle what the free tools we mentioned will accomplish for you. The joy of programming is working out all the little kinks like where DisplayName might not have a value or you have to use an alternate method (like file versions) to get what you need.

It just makes sense to save yourself the time, unless you just want to learn how to do it yourself.

Regards,
Scott

http://scottisageek.spaces.live.com

by nikki_j

Thanks for your advice Scott!
I found VBscript online and suceeded;)

by seanferd

A link might be helpful for others trying to do the same.

(Maybe Mark Scott's Post As Helpful, as well.) ;)

Glad you found something that worked. :)

by nikki_j

I lost the link but the VB script to retrieve installed information is below.
Hope it helps someone.

Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objReg = GetObject("WinMgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
strRegIdentityCodes = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
strRegComputerName = "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName"
strComputerName = objShell.RegRead(strRegComputerName)
Const HKLM = &H80000002
Const APPEND = 8
strFileOut = strComputerName & " Inventory.txt"
If objFSO.FileExists(strFileOut) Then
Set objFileOut = objFSO.OpenTextFile(strFileOut, APPEND)
objFileOut.WriteLine("")
Else
Set objFileOut = objFSO.CreateTextFile(strFileOut)
End If
objFileOut.WriteLine("Inventory for " & strComputerName & " at " & Now)
objFileOut.WriteLine("Computer Name" & vbTab & "Identity Code" & vbTab & "Display Name" & vbTab & _
"Display Version" & vbTab & "Install Date" & vbTab & "Uninstall String" & vbTab & _
"Quiet Uninstall String")
objReg.EnumKey HKLM, strRegIdentityCodes, arrIdentityCode
On Error Resume Next
For Each strIdentityCode in arrIdentityCode
strRegIdentityInfo = "HKLM\" & strRegIdentityCodes & "\" & strIdentityCode & "\"
strDisplayName = objShell.RegRead(strRegIdentityInfo & "DisplayName")
strDisplayVersion = objShell.RegRead(strRegIdentityInfo & "DisplayVersion")
strInstallDate = objShell.RegRead(strRegIdentityInfo & "InstallDate")
strUninstallString = objShell.RegRead(strRegIdentityInfo & "UninstallString")
strQuietUninstallString = objShell.RegRead(strRegIdentityInfo & "QuietUninstallString")
objFileOut.WriteLine(strComputerName & vbTab & strIdentityCode & vbTab & strDisplayName & vbTab & _
strDisplayVersion & vbTab & strInstallDate & vbTab & strUninstallString & vbTab & _
strQuietUninstallString)
strDisplayName = ""
strDisplayVersion =""
strInstallDate = ""
strUninstallString = ""
strQuietUninstallString = ""
Next
objFileOut.Close

by seanferd

So I can point others to it in the future.

Thank you for sharing. B-) :)

This discussion is closed to new replies.