Jump to content
Sign in to follow this  
microbious

How to get any windows executable file version ?

Recommended Posts

microbious

If it matters i run windows 7

I was trying the following.

$version = FileGetVersion (@ProgramsDir & "\Common Files\Macrovision Shared\FLEXnet Publisher\FNPLicensingService.exe")
MsgBox (0,'',$version)

Return was 0.0.0.0

But i know file version is 11.6.10 as is shows in file properties Details tab

Is there any other way to read file property value ?

Thanks in advance.

Share this post


Link to post
Share on other sites
omikron48

From help file:

Failure: Returns "0.0.0.0" if no version information (or other error) or "" when retrieving a stringname, and sets @error to 1.

Try using one of the strings for the second parameter:

stringname can be the basic one as :

Comments, InternalName, ProductName, CompanyName, LegalCopyright, ProductVersion,

FileDescription, LegalTrademarks, PrivateBuild, FileVersion, OriginalFilename, SpecialBuild

Edited by omikron48

Share this post


Link to post
Share on other sites
microbious

From help file:

Sorry i had wrong @programsdir instead of @programfilesdir :)

Ok so what does @error 1 tell me anyway ? Can i somehow translate @error to words i can understand ?

Thanks for quick reply and please, if you know how to read file property value's please do tell

Share this post


Link to post
Share on other sites
bo8ster

Again from the help file "@error - Status of the error flag. See the SetError function." Lets you know if a function encountered an error.


Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Share this post


Link to post
Share on other sites
omikron48

Haven't tried using FileGetVersion yet. But based from the help file, a return value of "0.0.0.0" and @error = 1 means that either there is no version info or the version info is a blank string.

In your case, I'd guess that you'd want to use the second parameter and see what you can get from there, like ProductVersion or FileVersion, maybe. See what information you can find from the exe.

Share this post


Link to post
Share on other sites
microbious

Haven't tried using FileGetVersion yet. But based from the help file, a return value of "0.0.0.0" and @error = 1 means that either there is no version info or the version info is a blank string.

In your case, I'd guess that you'd want to use the second parameter and see what you can get from there, like ProductVersion or FileVersion, maybe. See what information you can find from the exe.

already said that i used wrong path, so thats fixed.

how about reading other description values, like original name and language and product name and stuff ?

thanks in advance

Share this post


Link to post
Share on other sites
omikron48

I think that's where the second parameter comes in, with the stringname(s) and all that.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×