Solved

Checking The Version fo A File Over The Network

Posted on 2004-10-06
8
181 Views
Last Modified: 2010-04-14
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
0
Comment
Question by:Mohonk
  • 5
  • 2
8 Comments
 
LVL 69

Expert Comment

by:Callandor
ID: 12238299
I use a product called Synchromagic that can do this: http://www.gelosoft.com/adescr.html
0
 
LVL 76

Expert Comment

by:David Lee
ID: 12242802
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
0
 

Author Comment

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

Thanks!
0
 
LVL 76

Expert Comment

by:David Lee
ID: 12248898
Not hard at all.  I post a revised version with that shortly.
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 76

Expert Comment

by:David Lee
ID: 12248905
Darn fingers!  That should be I'll not I.
0
 
LVL 76

Accepted Solution

by:
David Lee earned 250 total points
ID: 12249997
Here you go.  This will write the output to a file in the folder the script is run from.  Change Filename.Txt to whatever file name you want to use.

Dim arrComputers, strPath, objFSO, objFile, objTS, intCounter
arrComputers = Array("\\Computer1", "\\Computer2")
strPath = "\C$\Windows\Notepad.Exe"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTS = objFSO.CreateTextFile(".\Filename.Txt", True)
For intCounter = 0 To UBound(arrComputers)
    Set objFile = objFSO.GetFile(arrComputers(intCounter) & strPath)
    objTS.WriteLine "Computer=" & arrComputers(intCounter)
    objTS.WriteLine "DateCreated=" & objFile.DateCreated
    objTS.WriteLine "Size=" & objFile.Size
    objTS.WriteLine "Version=" & objFSO.GetFileVersion(arrComputers(intCounter) & strPath)
    objTS.WriteLine ""
Next
objTS.Close
Set objTS = Nothing
Set objFile = Nothing
Set objFSO = Nothing
0
 

Author Comment

by:Mohonk
ID: 12250109
works great. thanks for the help!
0
 
LVL 76

Expert Comment

by:David Lee
ID: 12250551
Excellent.  You're welcome!
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
XP pro; manually run services in registry? 15 26
Adprep 12 58
no desktop when login to windows server 2000 7 322
Windows Server 2000 NIC on a 2008 R2 Hyper-V won't start 4 1,096
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now