Link to home
Start Free TrialLog in
Avatar of nummagumma2
nummagumma2Flag for United States of America

asked on

Show file version command line

Windows 2000 or Windows XP:

In the explorer GUI if I right click on a file I have a "VERSION" tab if the file has this attribute.  How do I read this from the command line?
ASKER CERTIFIED SOLUTION
Avatar of sirbounty
sirbounty
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 nummagumma2

ASKER

Neat.  Thanks!

I found a cmdline util that does it myself, this might be useful for you:

http://www.sysinternals.com/Utilities/Sigcheck.html

Using that tool I created a file that does this:

for /f "tokens=3" %%v in ('sigcheck "\\%comp%\c$\path\file.exe"^|find /i "version"') do set fVer=%%v
echo %fVer%

then I process what I need to with the fVer info.
Good info to have - I figured there would be a 3rd party out there, but I didn't run across any.
Thanx for the grade.

There's also, if you're interested a method to take the above scripted output and create an environment variable with the result, but I'd personally prefer the command line solution that you found.
I'm still (blissfully) ignorant of vbs so try to do as much as I can with .bat.... Old Dog, etc, etc.
Here's a command line version:

@echo off

for /F "delims=" %%a in ('cscript //nologo CheckVer.vbs myfile.exe') do set VerNo=%%a

echo VerNo: %VerNo%

I really love these scripts. I'm a novice at them myself. I'm learning from SirBounty here -- thanks :)