• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 343
  • Last Modified:

vbs to determine Software Versions

Hi I have a VB script to determine the versions of both Windows Media Player and Internet Explorer. What I would like to do at the end of the script is to export the data along with the PC name to a folder on the server (so I can get 100 or so users to run then I can check and update if required.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & _
    "\root\cimv2\Applications\MicrosoftIE")

Set colIESettings = objWMIService.ExecQuery _
    ("Select * from MicrosoftIE_Summary")

For Each strIESetting in colIESettings
    Wscript.Echo "Version: " & strIESetting.Version
next
Dim o
Set o = CreateObject("WMPlayer.OCX")
MsgBox o.VersionInfo
0
kwatt562
Asked:
kwatt562
1 Solution
 
Jorge PaulinoIT Pro/DeveloperCommented:
You can try something like this (not tested)
Dim message, myFSO, WriteStuff

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & _
    "\root\cimv2\Applications\MicrosoftIE")

Set colIESettings = objWMIService.ExecQuery _
    ("Select * from MicrosoftIE_Summary")

For Each strIESetting in colIESettings
    Wscript.Echo "Version: " & strIESetting.Version
next
Dim o 
Set o = CreateObject("WMPlayer.OCX")

message = o.VersionInfo

Set myFSO = CreateObject("Scripting.FileSystemObject")
Set WriteStuff = myFSO.OpenTextFile("c:\yourtextfile.txt", 8, True)
WriteStuff.WriteLine(message)
WriteStuff.Close
Set WriteStuff = Nothing
Set myFSO = Nothing

Open in new window

0
 
RobSampsonCommented:
Try this as well, which will write to separate files for each computer.

Regards,

Rob.
Set objNetwork = CreateObject("WScript.Network")
Set objFSO = CreateObject("Scripting.FileSystemObject")

strComputer = "."
If strComputer = "." Then
	strOutput = "\\server\share\" & objNetwork.ComputerName & "_versions.txt"
Else
	strOutput = "\\server\share\" & strComputer & "_versions.txt"
End If
	
Set objWMIService = GetObject("winmgmts:\\" & strComputer & _
    "\root\cimv2\Applications\MicrosoftIE")

Set colIESettings = objWMIService.ExecQuery _
    ("Select * from MicrosoftIE_Summary")

For Each strIESetting in colIESettings
	strMessage = "IE Version:"  & strIESetting.Version
Next
Dim o
Set o = CreateObject("WMPlayer.OCX")
strMessage = strMessage & "," & "WMP Version: " & o.VersionInfo

Set objOutput = objFSO.CreateTextFile(strOutput, True)
objOutput.WriteLine strMessage
objOutput.Close

Open in new window

0
 
kwatt562Author Commented:
Genius, thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now