• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1834
  • Last Modified:

VB6: Using fso.getfileversion("my.exe") returns 4 numbers..

Hi all

I have an app where Version Major=2, Minor=0, and Revision=2.  My thinking is that this would display 2.0.2 as the version number.

When I run the below function, the MsgBox value is 2.0.0.2  

Why is it not 2.0.2, and what's the best way to do an apples-to-apples comparison here?
____

Public Function fn_get_exe_version_number()

Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
MsgBox fso.getfileversion("myapp.exe")

End Function
_____

Thanks.
-Jim

0
Jim Horn
Asked:
Jim Horn
2 Solutions
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>Why is it not 2.0.2
why? well, because windows actually has 4 numbers for versions, but vb indeed only 3.
ask billy :-)

> and what's the best way to do an apples-to-apples comparison here?
I would compile a test app with major=1, minor=2 and revision=3 and see what the getfileversion returns from there :-)
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
A vb.exe with Major=1, Minor=2, and Revision=3, when tested with fso.getfileversion, returned 1.2.0.3
0
 
lunchbyteCommented:
The third set of the version number is always zero for VB app. I always wondered why but it’s the way it is.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now