Link to home
Start Free TrialLog in
Avatar of mchristo63
mchristo63

asked on

I need a script

Not being that familar with scripts, I look to the experts for advice.  I need a script that will report a file version on a number of servers.  I have the following script that works well, but I have to OK through each server.  I would like to to output the results in a list or some kind of file.  

WScript.Echo "Server name" & vbTab & "File Version"
'WScript.Echo "-----------" & vbTab & "-----------------"

Const ForReading = 1
Set objDictionary = CreateObject("Scripting.Dictionary")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("C:\servers.txt", ForReading)
i = 0
Do Until objTextFile.AtEndOfStream
   strNextLine = objTextFile.Readline
   objDictionary.Add i, strNextLine
   i = i + 1
Loop
For Each objItem in objDictionary
   Set objFSO = CreateObject("Scripting.FileSystemObject")
   Wscript.Echo objDictionary.Item(objItem) & vbTab & objFSO.GetFileVersion _
("\\"& objDictionary.Item(objItem) & "\C$\Program Files\application\file.exe")                  

Next



Thanks
ASKER CERTIFIED SOLUTION
Avatar of fulscher
fulscher

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fulscher
fulscher

Ups - an explanation: This creates a file C:\report.txt (erases it if it is not empty) and writes your report into that file.
Hope this helps
J
Avatar of mchristo63

ASKER

Excellent!
Thank you!