Link to home
Start Free TrialLog in
Avatar of Mohonk
MohonkFlag for United States of America

asked on

Checking The Version fo A File Over The Network

Does anyone know of a good way to check the version of a file over my LAN? I have about 100 computers that all need the same version of a particular EXE file. They are all located in the same directory on every computer. Is there a program or way out there to do this easily? The main things i would need to check is the size/date/version info on the file.

Thanks
Avatar of Callandor
Callandor
Flag of United States of America image

I use a product called Synchromagic that can do this: http://www.gelosoft.com/adescr.html
Here's a pretty simple script that'll do it for you.  It will loop through the names of the computers you provide in arrComputers, connect to the file specified by strPath, and return the Date Created, Size, and Version number.  The version number will only work for executables (exe, dll, ocx).  In this sample it merely displays the information about each file onscreen.  It'd be simple to modify it to write the information into a file instead.  In fact, the script could be modified to create another script or batch file that'd copy a new version to machines that needed an update.  You'd need to include a target version number to comapre against if you wanted to go that route.

To use this script all you need to do is copy and paste the script into a file with an extension of .vbs.  Then edit lines 2 and 3 to supply the names of the computers and the path to the file you want to check.  You'll need to have the required rights on the target computers for this to work.  Then run the script.

    Dim arrComputers, strPath, objFSO, objFile, intCounter
    arrComputers = Array("\\Computer1", "\\Computer2")
    strPath = "\C$\Windows\Notepad.Exe"
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    For intCounter = 0 To UBound(arrComputers)
        Set objFile = objFSO.GetFile(arrComputers(intCounter) & strPath)
        Wscript.Echo "Computer=" & arrComputers(intCounter)
        Wscript.Echo "DateCreated=" & objFile.DateCreated
        Wscript.Echo "Size=" & objFile.Size
        Wscript.Echo "Version=" & objFSO.GetFileVersion(arrComputers(intCounter) & strPath)
        Wscript.Echo ""
    Next
    Set objFile = Nothing
    Set objFSO = Nothing
Avatar of Mohonk

ASKER

That works very well thank you. How hard would it be to add a line to dump the information to a txt file?

Thanks!
Not hard at all.  I post a revised version with that shortly.
Darn fingers!  That should be I'll not I.
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

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 Mohonk

ASKER

works great. thanks for the help!
Excellent.  You're welcome!