Solved

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

Posted on 2006-10-26
3
1,714 Views
Last Modified: 2008-01-09
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
Comment
Question by:Jim Horn
3 Comments
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 50 total points
ID: 17812309
>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
 
LVL 65

Author Comment

by:Jim Horn
ID: 17812350
A vb.exe with Major=1, Minor=2, and Revision=3, when tested with fso.getfileversion, returned 1.2.0.3
0
 
LVL 5

Accepted Solution

by:
lunchbyte earned 450 total points
ID: 17813007
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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now