Solved

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

Posted on 2006-10-26
3
1,761 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 143

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

733 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