Re: Extended file properties

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Fosco (fake_at_fake.invalid)
Date: 08/28/04

  • Next message: Alex K. Angelopoulos [MVP]: "Re: 15 digit numbers limitation"
    Date: Sat, 28 Aug 2004 04:42:22 GMT
    
    

    "tet1953"
    > I have searched the forum for tips on how to get extended file
    > properties, but haven't had any luck yet. What I'm after specifically
    > is version information, such as that found when a file is
    > right-clicked in Windows Explorer, then under the Version tab. The
    > number given for Product Version would be perfect.

    Set oFSO = CreateObject("Scripting.FileSystemObject")
    sFilePath = "C:\windows\explorer.exe"
      sFileVer = oFSO.GetFileVersion(sFilePath)
     WScript.Echo sFileVer
    sFilePath2 = "C:\WINDOWS\SYSTEM\SHELL32.DLL"
      sFileVer2 = oFSO.GetFileVersion(sFilePath2)
     WScript.Echo sFileVer2

    ' copied from this newsgoup maybe next time try first
    ' http://groups.google.com/advanced_group_search

    sRegPath = "HKLM\SOFTWARE\Microsoft\Internet Explorer\Version"
    Set oShell = CreateObject("wscript.shell")
    On Error Resume Next
    sIEVer = oShell.RegRead(sRegPath)
    If Err <> 0 Then
      sIEVer = "0.0.0.0"
    End If
    On Error Goto 0
    aIEVer = Split(sIEVer, ".")
    iMajorVersion = Cint(aIEVer(0))
    iMinorVersion = Cint(aIEVer(1))
    iBuildVersion = Cint(aIEVer(2))
    iSubBuildVersion = Cint(aIEVer(3))
    WScript.Echo "IE full version is : " & sIEVer
    WScript.Echo "IE version is : " & iMajorVersion & "." & iMinorVersion

    --
    Fosco
    

  • Next message: Alex K. Angelopoulos [MVP]: "Re: 15 digit numbers limitation"