Jump to content

How to get any windows executable file version ?


Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...