locked
Get File Information RRS feed

  • Question

  • Hello, I have read on how to get some of the file information such as time stamps... etc

     

    But what i'm looking for is a bit more advanced...

    The information to extract that i'm looking for is as such...

    "FileDescription"

    "Company" 
    "FileVersion"
    "Comments"
    "InternalName"
    "LegalCopyright"
    "LegalTrademarks" 
    "OriginalFilename" 
    "ProductName"
    "ProductVersion"
    "PrivateBuild" 
    "SpecialBuild"
    "LegalTrademarks1"
    "LegalTrademarks2"

    ~ Dmitry


    Attributor 2.0
    Saturday, November 13, 2010 8:56 AM

Answers

  • Hi Dmitry,

    FileVersionInfo provides that information (except for LegalTrademark1/2 - I only see a single property there):

    Dim strFile As String = _
      System.IO.Path.Combine(Environment.SystemDirectory, "Notepad.exe")
    Dim fi As System.IO.FileInfo = New System.IO.FileInfo(strFile)
    Dim fvi As System.Diagnostics.FileVersionInfo = _
      System.Diagnostics.FileVersionInfo.GetVersionInfo(strFile)
    MessageBox.Show( _
      "File properties for " & fi.Name & ":" & Environment.NewLine & _
       "FileDescription: " & fvi.FileDescription & Environment.NewLine & _
       "CompanyName: " & fvi.CompanyName & Environment.NewLine & _
       "FileVersion: " & fvi.FileVersion & Environment.NewLine & _
       "Comments: " & fvi.Comments & Environment.NewLine & _
       "InternalName: " & fvi.InternalName & Environment.NewLine & _
       "LegalCopyright: " & fvi.LegalCopyright & Environment.NewLine & _
       "LegalTrademarks: " & fvi.LegalTrademarks & Environment.NewLine & _
       "OriginalFilename: " & fvi.OriginalFilename & Environment.NewLine & _
       "ProductName: " & fvi.ProductName & Environment.NewLine & _
       "ProductVersion: " & fvi.ProductVersion & Environment.NewLine & _
       "PrivateBuild: " & fvi.PrivateBuild & Environment.NewLine & _
       "SpecialBuild: " & fvi.SpecialBuild & Environment.NewLine & _
       "LegalTrademarks: " & fvi.LegalTrademarks)
    
    


    Cheers,
    Olaf
    http://blogs.intuidev.com
    • Marked as answer by Dmitry Post Saturday, November 13, 2010 9:41 AM
    Saturday, November 13, 2010 9:20 AM