|
|
I can use successfully a script for enumerate the installed software in a Windows XP based computer, but if I try to use the same script in a Windows 2003 Server, the script does not work.
In the XP Computer, the WMI Class Win32_Product exists, but do not exist in Windows Server 2003
How can I enumerate the installed software on a Windows Server
Thanks for all your support -- Alejandro AM
|
|
Alejandro, can you send me the original script that works for you on the xp computer
Thanks
John
"Alejandro AM" wrote:
[Quoted Text] > I can use successfully a script for enumerate the installed software in a > Windows XP based computer, but if I try to use the same script in a Windows > 2003 Server, the script does not work. > > In the XP Computer, the WMI Class Win32_Product exists, but do not exist in > Windows Server 2003 > > How can I enumerate the installed software on a Windows Server > > Thanks for all your support > -- > Alejandro AM
|
|
On Error Resume Next
strComputer = "." Const ForWriting = 2 Const ForAppending = 2
Set objFSO = CreateObject("Scripting.FileSystemObject") Set objLogFile = objFSO.CreateTextFile("C:\HP\software.csv", _ ForWriting, True)
objLogFile.Write chr(34) & "Description" & chr(34) & "," objLogFile.Write chr(34) & "Identifying Number" & chr(34) & "," objLogFile.Write chr(34) & "Installation Date" & chr(34) & "," objLogFile.Write chr(34) & "Installation Location" & chr(34) & "," objLogFile.Write chr(34) & "Installation State" & chr(34) & "," objLogFile.Write chr(34) & "Name" & chr(34) & "," objLogFile.Write chr(34) & "Package Cache" & chr(34) & "," objLogFile.Write chr(34) & "SKU Number" & chr(34) & "," objLogFile.Write chr(34) & "Vendor" & chr(34) & "," objLogFile.Write chr(34) & "Version" & chr(34) objLogFile.Writeline
Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colSoftware = objWMIService.ExecQuery _ ("Select * from Win32_Product") For Each objSoftware in colSoftware objLogFile.Write chr(34) & objSoftware.Description & chr(34) & "," objLogFile.Write chr(34) & objSoftware.IdentifyingNumber & chr(34) & "," objLogFile.Write chr(34) & objSoftware.InstallDate2 & chr(34) & "," objLogFile.Write chr(34) & objSoftware.InstallLocation & chr(34) & "," objLogFile.Write chr(34) & objSoftware.InstallState & chr(34) & "," objLogFile.Write chr(34) & objSoftware.Name & chr(34) & "," objLogFile.Write chr(34) & objSoftware.PackageCache & chr(34) & "," objLogFile.Write chr(34) & objSoftware.SKUNumber & chr(34) & "," objLogFile.Write chr(34) & objSoftware.Vendor & chr(34) & "," objLogFile.Write chr(34) & objSoftware.Version & chr(34) & "," objLogFile.Writeline Next
Wscript.Echo "Done!" -- Alejandro AM
"John King" wrote:
[Quoted Text] > Alejandro, can you send me the original script that works for you on the xp > computer > > Thanks > > John > > "Alejandro AM" wrote: > > > I can use successfully a script for enumerate the installed software in a > > Windows XP based computer, but if I try to use the same script in a Windows > > 2003 Server, the script does not work. > > > > In the XP Computer, the WMI Class Win32_Product exists, but do not exist in > > Windows Server 2003 > > > > How can I enumerate the installed software on a Windows Server > > > > Thanks for all your support > > -- > > Alejandro AM
|
|
Thanks Alejandro !!
"Alejandro AM" wrote:
[Quoted Text] > On Error Resume Next > > strComputer = "." > Const ForWriting = 2 > Const ForAppending = 2 > > Set objFSO = CreateObject("Scripting.FileSystemObject") > Set objLogFile = objFSO.CreateTextFile("C:\HP\software.csv", _ > ForWriting, True) > > objLogFile.Write chr(34) & "Description" & chr(34) & "," > objLogFile.Write chr(34) & "Identifying Number" & chr(34) & "," > objLogFile.Write chr(34) & "Installation Date" & chr(34) & "," > objLogFile.Write chr(34) & "Installation Location" & chr(34) & "," > objLogFile.Write chr(34) & "Installation State" & chr(34) & "," > objLogFile.Write chr(34) & "Name" & chr(34) & "," > objLogFile.Write chr(34) & "Package Cache" & chr(34) & "," > objLogFile.Write chr(34) & "SKU Number" & chr(34) & "," > objLogFile.Write chr(34) & "Vendor" & chr(34) & "," > objLogFile.Write chr(34) & "Version" & chr(34) > objLogFile.Writeline > > > Set objWMIService = GetObject("winmgmts:" _ > & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") > Set colSoftware = objWMIService.ExecQuery _ > ("Select * from Win32_Product") > For Each objSoftware in colSoftware > objLogFile.Write chr(34) & objSoftware.Description & chr(34) & "," > objLogFile.Write chr(34) & objSoftware.IdentifyingNumber & chr(34) & "," > objLogFile.Write chr(34) & objSoftware.InstallDate2 & chr(34) & "," > objLogFile.Write chr(34) & objSoftware.InstallLocation & chr(34) & "," > objLogFile.Write chr(34) & objSoftware.InstallState & chr(34) & "," > objLogFile.Write chr(34) & objSoftware.Name & chr(34) & "," > objLogFile.Write chr(34) & objSoftware.PackageCache & chr(34) & "," > objLogFile.Write chr(34) & objSoftware.SKUNumber & chr(34) & "," > objLogFile.Write chr(34) & objSoftware.Vendor & chr(34) & "," > objLogFile.Write chr(34) & objSoftware.Version & chr(34) & "," > objLogFile.Writeline > Next > > Wscript.Echo "Done!" > -- > Alejandro AM > > > "John King" wrote: > > > Alejandro, can you send me the original script that works for you on the xp > > computer > > > > Thanks > > > > John > > > > "Alejandro AM" wrote: > > > > > I can use successfully a script for enumerate the installed software in a > > > Windows XP based computer, but if I try to use the same script in a Windows > > > 2003 Server, the script does not work. > > > > > > In the XP Computer, the WMI Class Win32_Product exists, but do not exist in > > > Windows Server 2003 > > > > > > How can I enumerate the installed software on a Windows Server > > > > > > Thanks for all your support > > > -- > > > Alejandro AM
|
|
Hi Alejandro, one more question, if my system has more than one drive or is partitoned and some of my software is installed into the partition, how can I modify the script to "detect" those installations or software locations ? I ran your script successfully but it only came back with the software packages installed on the c drive.
Thanks again
John
"Alejandro AM" wrote:
[Quoted Text] > On Error Resume Next > > strComputer = "." > Const ForWriting = 2 > Const ForAppending = 2 > > Set objFSO = CreateObject("Scripting.FileSystemObject") > Set objLogFile = objFSO.CreateTextFile("C:\HP\software.csv", _ > ForWriting, True) > > objLogFile.Write chr(34) & "Description" & chr(34) & "," > objLogFile.Write chr(34) & "Identifying Number" & chr(34) & "," > objLogFile.Write chr(34) & "Installation Date" & chr(34) & "," > objLogFile.Write chr(34) & "Installation Location" & chr(34) & "," > objLogFile.Write chr(34) & "Installation State" & chr(34) & "," > objLogFile.Write chr(34) & "Name" & chr(34) & "," > objLogFile.Write chr(34) & "Package Cache" & chr(34) & "," > objLogFile.Write chr(34) & "SKU Number" & chr(34) & "," > objLogFile.Write chr(34) & "Vendor" & chr(34) & "," > objLogFile.Write chr(34) & "Version" & chr(34) > objLogFile.Writeline > > > Set objWMIService = GetObject("winmgmts:" _ > & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") > Set colSoftware = objWMIService.ExecQuery _ > ("Select * from Win32_Product") > For Each objSoftware in colSoftware > objLogFile.Write chr(34) & objSoftware.Description & chr(34) & "," > objLogFile.Write chr(34) & objSoftware.IdentifyingNumber & chr(34) & "," > objLogFile.Write chr(34) & objSoftware.InstallDate2 & chr(34) & "," > objLogFile.Write chr(34) & objSoftware.InstallLocation & chr(34) & "," > objLogFile.Write chr(34) & objSoftware.InstallState & chr(34) & "," > objLogFile.Write chr(34) & objSoftware.Name & chr(34) & "," > objLogFile.Write chr(34) & objSoftware.PackageCache & chr(34) & "," > objLogFile.Write chr(34) & objSoftware.SKUNumber & chr(34) & "," > objLogFile.Write chr(34) & objSoftware.Vendor & chr(34) & "," > objLogFile.Write chr(34) & objSoftware.Version & chr(34) & "," > objLogFile.Writeline > Next > > Wscript.Echo "Done!" > -- > Alejandro AM > > > "John King" wrote: > > > Alejandro, can you send me the original script that works for you on the xp > > computer > > > > Thanks > > > > John > > > > "Alejandro AM" wrote: > > > > > I can use successfully a script for enumerate the installed software in a > > > Windows XP based computer, but if I try to use the same script in a Windows > > > 2003 Server, the script does not work. > > > > > > In the XP Computer, the WMI Class Win32_Product exists, but do not exist in > > > Windows Server 2003 > > > > > > How can I enumerate the installed software on a Windows Server > > > > > > Thanks for all your support > > > -- > > > Alejandro AM
|
|
|