MjukisDjur
30-08-04, 21:07
I am working on a simple script that show computer name, diskspace, windows version bla bla bla etc.
Now, I would like to dump the version of Office to the file as well. How in gods name do I do that?
I can use win32_product to dump ALL software installed but i only want the Office part to show.
Can someone tell how to filter the script to only show software with "Microsoft Office" in it?
It can be done, right? I not skilled enough to do such thing.
I can just cut and paste different scripts into one and make it look like I want. :)
Original win32_product script:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Product",,48)
For Each objItem in colItems
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "IdentifyingNumber: " & objItem.IdentifyingNumber
Wscript.Echo "InstallDate: " & objItem.InstallDate
Wscript.Echo "InstallDate2: " & objItem.InstallDate2
Wscript.Echo "InstallLocation: " & objItem.InstallLocation
Wscript.Echo "InstallState: " & objItem.InstallState
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "PackageCache: " & objItem.PackageCache
Wscript.Echo "SKUNumber: " & objItem.SKUNumber
Wscript.Echo "Vendor: " & objItem.Vendor
Wscript.Echo "Version: " & objItem.Version
Next
Help me :)
Regards
Mjukisdjur
Now, I would like to dump the version of Office to the file as well. How in gods name do I do that?
I can use win32_product to dump ALL software installed but i only want the Office part to show.
Can someone tell how to filter the script to only show software with "Microsoft Office" in it?
It can be done, right? I not skilled enough to do such thing.
I can just cut and paste different scripts into one and make it look like I want. :)
Original win32_product script:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Product",,48)
For Each objItem in colItems
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "IdentifyingNumber: " & objItem.IdentifyingNumber
Wscript.Echo "InstallDate: " & objItem.InstallDate
Wscript.Echo "InstallDate2: " & objItem.InstallDate2
Wscript.Echo "InstallLocation: " & objItem.InstallLocation
Wscript.Echo "InstallState: " & objItem.InstallState
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "PackageCache: " & objItem.PackageCache
Wscript.Echo "SKUNumber: " & objItem.SKUNumber
Wscript.Echo "Vendor: " & objItem.Vendor
Wscript.Echo "Version: " & objItem.Version
Next
Help me :)
Regards
Mjukisdjur