Results 1 to 2 of 2

Thread: getting file version

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Location
    South Africa
    Posts
    105

    getting file version

    Hi there

    I am wanting to get the version number of a file. I am currently using the FileSystemObject. It works great, but I would rather not package scrrun.dll with my application. Is there any way to get version information without having to rely on scrrun.dll?

    Many thanks

    langals

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: getting file version

    This is a bit of code I found a while back:
    you will have to mess with it to make it work for just one file
    it currently loops through a directory and adds info to a textbox

    VB Code:
    1. Dim arrHeaders(41)
    2. Set objShell = CreateObject("Shell.Application")
    3. Set objFolder = objShell.NameSpace("c:\")
    4. For i = 0 To 40
    5.     arrHeaders(i) = objFolder.GetDetailsOf(objFolder.Items, i)
    6. Next
    7. For Each strfilename In objFolder.Items
    8.     If objFolder.GetDetailsOf(strfilename, 2) <> "File Folder" Then 'Skips Folders
    9.     For i = 0 To 40
    10.         Text1 = Text1 & i & " - " & arrHeaders(i) & ": " & objFolder.GetDetailsOf(strfilename, i) & vbCrLf
    11.     Next
    12.     End If
    13. Next

    I think # 37 or #39 that comes out is the version number
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width