File properties like getFileVersion ... 
Author Message
 File properties like getFileVersion ...

I need to collect all the file properties that you can see if you right
click on a WIN32 binary in Explorer.

Under Windows 2000, when I use the getFileVersion it actually returns the
Product Version property. I need to get the File Version (and others).

Any ideas?   This is what I'm using to get the product version:

--------------------------------------------------------------
Sub GetVersion (aFile)
Dim fso, rc
Set fso = CreateObject("Scripting.FileSystemObject")
 rc = fso.getFileVersion (aFile)
 If Len(rc) Then
  WScript.Echo rc
 else
  WScript.Echo "No version information available."
 End If
End Sub
---------------------------------------------------------------

John Reeder



Sat, 14 Sep 2002 03:00:00 GMT  
 File properties like getFileVersion ...
What you want I believe is this from the File Object Properties (I put
together some of the common ones from the samples in VBScript 5.1
Documentation for you, hopefully no typo's :)):

Wscript.Echo ShowFileAccessInfo("C:\autoexec.bat")

Function ShowFileAccessInfo(filespec)
  Dim fso, f, s
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set f = fso.GetFile(filespec)
  s = UCase(filespec) & VBCRLF
  s = s & "Created: " & f.DateCreated & VBCRLF
  s = s & "Last Accessed: " & f.DateLastAccessed & VBCRLF
  s = s & "Last Modified: " & f.DateLastModified  & VBCRLF
  s = s & "File Size (Bytes): " & f.Size & VBCRLF
  s = s & "File Type: " & f.Type & VBCRLF
  s = s & "Short Name: " & f.ShortName & VBCRLF
  s = s & "Path: "& f.Path & VBCRLF
  s = s & "Attributes: "& f.Attributes & VBCRLF
  ShowFileAccessInfo = s
  Set f = Nothing
  Set fso = Nothing
End Function

Shawn


Quote:
> I need to collect all the file properties that you can see if you right
> click on a WIN32 binary in Explorer.

> Under Windows 2000, when I use the getFileVersion it actually returns the
> Product Version property. I need to get the File Version (and others).

> Any ideas?   This is what I'm using to get the product version:

> --------------------------------------------------------------
> Sub GetVersion (aFile)
> Dim fso, rc
> Set fso = CreateObject("Scripting.FileSystemObject")
>  rc = fso.getFileVersion (aFile)
>  If Len(rc) Then
>   WScript.Echo rc
>  else
>   WScript.Echo "No version information available."
>  End If
> End Sub
> ---------------------------------------------------------------

> John Reeder



Sun, 15 Sep 2002 03:00:00 GMT  
 File properties like getFileVersion ...
I've posted a component which does what you need. See the Post "An object
for analyzing version data", March 22, 2000. If you want to have FileVersion
and ProductVersion, simply use:

    Set ver = GetVersion("version:yourfilename")
    WScript.Echo ver.FileVersion, ver.ProductVersion

Enumerating the language specific data can be done by:

    For Each key In ver.Items
        WScript.Echo key & "=" & ver(key)
    Next

Uwe
----------------


Quote:
> I need to collect all the file properties that you can see if you right
> click on a WIN32 binary in Explorer.

> Under Windows 2000, when I use the getFileVersion it actually returns the
> Product Version property. I need to get the File Version (and others).

> Any ideas?   This is what I'm using to get the product version:

> --------------------------------------------------------------
> Sub GetVersion (aFile)
> Dim fso, rc
> Set fso = CreateObject("Scripting.FileSystemObject")
>  rc = fso.getFileVersion (aFile)
>  If Len(rc) Then
>   WScript.Echo rc
>  else
>   WScript.Echo "No version information available."
>  End If
> End Sub
> ---------------------------------------------------------------

> John Reeder



Wed, 18 Sep 2002 03:00:00 GMT  
 File properties like getFileVersion ...
Thanks - I've grabbed it and will give it a try this weekend!

John Reeder


Quote:
> I've posted a component which does what you need. See the Post "An object
> for analyzing version data", March 22, 2000. If you want to have
FileVersion
> and ProductVersion, simply use:

>     Set ver = GetVersion("version:yourfilename")
>     WScript.Echo ver.FileVersion, ver.ProductVersion

> Enumerating the language specific data can be done by:

>     For Each key In ver.Items
>         WScript.Echo key & "=" & ver(key)
>     Next

> Uwe
> ----------------


> > I need to collect all the file properties that you can see if you right
> > click on a WIN32 binary in Explorer.

> > Under Windows 2000, when I use the getFileVersion it actually returns
the
> > Product Version property. I need to get the File Version (and others).

> > Any ideas?   This is what I'm using to get the product version:

> > --------------------------------------------------------------
> > Sub GetVersion (aFile)
> > Dim fso, rc
> > Set fso = CreateObject("Scripting.FileSystemObject")
> >  rc = fso.getFileVersion (aFile)
> >  If Len(rc) Then
> >   WScript.Echo rc
> >  else
> >   WScript.Echo "No version information available."
> >  End If
> > End Sub
> > ---------------------------------------------------------------

> > John Reeder



Wed, 18 Sep 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. GetFileVersion

2. GetFileVersion Method??????

3. GetFileVersion

4. GetFileVersion question?

5. GetFileVersion Method??????

6. GetFileVersion design

7. GetFileVersion

8. GetFileVersion on NT4 (SP4)

9. FSO.GetFileVersion says "Object doesn't support this property or method"

10. File access - Getting last updated property of a file

11. Property Let, Property Get

12. Need to read file properties through ASP Webpage

 

 
Powered by phpBB® Forum Software