I'm writing a program that needs to get the version number of another file (such as the rundll32.exe file). Can anyone help me with this?
Printable View
I'm writing a program that needs to get the version number of another file (such as the rundll32.exe file). Can anyone help me with this?
I personally like using the API for most everything, but you could also use the FilesystemObject:
Code:
Private Sub Command1_Click()
'This would be if you referenced the object
'If you doing set the reference, you would need to use
'the createobject like this:
'Dim fso
'Set fso=CreateObject("scripting.FilesystemObject")
Dim FSO As FileSystemObject
Set FSO = New FileSystemObject
MsgBox FSO.GetFileVersion("c:\windows\rundll32.exe")
End Sub
I don't think VB5 supports FileSystemObject, though.
Megatron,
You might know better then I, but as long as you have the scrrun.dll on you machine (and this in native to Win98 and I believe NT 3.51 or can be download from just about anywhere [I usually get updates when I download new VBscript versions]) you could at the very least, use the CreateObject method and late bind the object (even if vb5 doesn't support it). You just wouldn't get the benefit of MS's intellsense to find all the functions/subs that you can use in the object.
They both worked great! Thanks!