VBScript For Finding a File Version

A quick post to show how to find the file version of any file.

For example:

If I want to find the file version of this driver file C:\WINDOWS\system32\drivers\Netwxn00.sys (Intel Wireless Driver) use the follwing

strAppExists =  CreateObject(“Scripting.FileSystemObject”).GetFileVersion(“C:\WINDOWS\system32\drivers\Netwxn00.sys”)

This will basically do the same as right clicking the file, go to version tab, and should the file version.  This is helpful when packaging and scripting to skip the installation of a program if it already exists. 

You can verify it’s working correctly by just echoing the following command

Wscript.Echo strAppExists

May seem a obvious but its always great to double check!

This entry was posted in Application Packaging. Bookmark the permalink. Follow any comments here with the RSS feed for this post. Post a comment or leave a trackback.

Leave a Reply

Your email address will not be published. Required fields are marked *

Your email address will never be published.