Get Version of a program

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply
adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Get Version of a program

Post by adroege » Tue Dec 14, 2004 9:29 pm

I would like to be able to retrieve the version of an .exe or .dll file -- similar to what you get when you right click ->properties->version->file version in windowsXP.

Is there another way to do this that I am missing? Something in VBScript maybe?


Thanks.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Dec 14, 2004 10:01 pm

Yep, like this:


VBSTART
Function FileVer(filename)
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
FileVer=objFSO.GetFileVersion(filename)
End Function
VBEND
VBEval>FileVer("C:\WINDOWS\system32\nslookup.exe"),ver
MessageModal>ver
MJT Net Support
[email protected]

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Version Info

Post by adroege » Tue Dec 14, 2004 10:13 pm

That is WONDERFUL!

Thank you VERY MUCH!!!!!!!!!!!!!!!!!!!!!!!!!

I continue to be VERY impressed with MJTNET.

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Tue Aug 30, 2005 7:27 am

I Am Currently Using A Script Which Has The Program's Version Number In As A Wait Window Command.

What I Am Trying To Do Is Have The Macro Use The Above Posted Script To Obtain The Version Number So I Can Use The Macro.

The Problem I Am Having Is That The Version Number Is 1.3.0.61, However In The Program Window Title Its 1.3.61 Window Title* However It Needs To Be Exact.
FIREFIGHTER

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Aug 30, 2005 2:21 pm

CyberCitizen,
I may be missing something here but... To do exactly what you've asked with this particular version number and using the Separate function as you suggested, try something like this:
Let>ver=1.3.0.61
Let>newver=
Sep>ver,.,part
Let>k=0
Repeat>k
If>newver
concat>newver,.
EndIf
Let>k=k+1
Let>tempvar=part_%k%
If>tempvar0
concat>newver,tempvar
EndIf
Until>k,part_count

MDL>%newver%
Make sure there are no trailing spaces.

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Wed Aug 31, 2005 2:18 am

Thanks For The Script JRL,

However The Result I Am Getting From The Script Is 1.3..61 Where As I Need To Obtain 1.3.61 (Without The Extra Dot).
FIREFIGHTER

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Aug 31, 2005 2:50 am

Oops... guess I didn't carefully examine the answer, I missed the double dot.

try this one:
Let>ver=1.3.0.61
Let>newver=
Sep>ver,.,part
Let>k=0
Repeat>k
If>newver
concat>newver,.
EndIf
Let>k=k+1
Let>tempvar=part_%k%
If>tempvar0
concat>newver,tempvar
Else
Len>newver,le
Let>le=le-1
Midstr>newver,1,le,newver2
Let>newver=newver2
EndIf
Until>k,part_count

MDL>%newver%
Hope this is better,
Dick

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Thu Sep 01, 2005 7:42 am

Thanks JRL,

Everything Appears To Be Working Ok Now. I Know Enough About MS To Get Me into Trouble LOL, However I Am Still Learning The Commands, I Will Be Analysing Your Code So i Can Learn.

Thanks For The Help.
FIREFIGHTER

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts