Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

File version info

62 views
Skip to first unread message

Teena

unread,
Aug 5, 2002, 10:45:43 AM8/5/02
to
Upon further research, I see the getfileversion and getfilename methods
in
the wsh 5.6 documentation, which is a good start. I think I was too
specific in the previous request below. I would like to access and to
pull
all of the information on the General and Version tabs in a given file's

properties (i.e. size, path, version, etc.). How can this be done? TIA
for
any helpful input!

Torgeir Bakken wrote:

> Teena wrote:
>
> > Greetings all. If you right click on almost any executable and
select
> > properties, there will be a version tab in the properties box. How
> > would I access that file version info using vbscript?
>
> Hi
>
> Set oFSO = CreateObject("Scripting.FileSystemObject")
> WScript.Echo oFSO.GetFileVersion("c:\winnt\system32\msi.dll")
>
> --
> torgeir

Torgeir Bakken

unread,
Aug 5, 2002, 12:53:16 PM8/5/02
to
Teena wrote:

> Upon further research, I see the getfileversion and getfilename methods
> in
> the wsh 5.6 documentation, which is a good start. I think I was too
> specific in the previous request below. I would like to access and to
> pull

> ahttp://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/ll


> of the information on the General and Version tabs in a given file's
>
> properties (i.e. size, path, version, etc.). How can this be done? TIA
> for
> any helpful input!

Hi

From WSH\FSO, this is what you get:

GetFileVersion method for file version

and the file object that gives you:
Attributes Property | DateCreated Property | DateLastAccessed Property |
DateLastModified Property | Drive Property | Name Property | ParentFolder
Property | Path Property | ShortName Property | ShortPath Property | Size
Property | Type Property

That covers the version on the On the Version tab and everything on the General
tab I guess.

For everyting else, like e.g. Description, it's getting messy, see A) and B)
below:


*******************************
A)

Message-ID: <aeq649$dbu$1...@slb5.atl.mindspring.net>
From: mayayana (maya...@mindspring.com)
Subject: Re: Properties of DLL files
Newsgroups: microsoft.public.scripting.vbscript
Date: 2002-06-19 07:54:10 PST
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=aeq649%24dbu%241%40slb5.atl.mindspring.net

<qoute>
You can get file name, version, etc. with FSO. Beyond that you have to use API
or a direct binary read of the file. For a direct binary read you need to deal
with the structure of a PE file, which is very involved, but probably more
doable than accessing the necessary APIs. If that's really what you want I have
a component that provides binary file functions. The download includes a sample
script to read an export table from a DLL. (You'll need to get the documentation
for PE file structure, too.)
http://www.jsware.net/jsware/scripts.html

(see JSBin.DLL near bottom)
--
--
Alex <a...@lusas.com> wrote in message news:ONKfWv2FCHA.2564@tkmsftngp04...
> Hi,
>
> I would like to write a vbscript (*.vbs) that will give me the properties of
> a *.dll file i.e. 'File version', 'Internal Name' etc...
> The end result would be a list similar to that of the 'Version' tab when a
> right click 'Properties' is carried out.
>
> Thank in advance
> AO


</qoute>

*******************************
B)

Take a look at this thread:

From: Alon Rosenfeld (alon_ro...@hotmail.com)
Subject: Accessing file properties
Newsgroups: microsoft.public.scripting.wsh, microsoft.public.scripting.vbscript,
microsoft.public.scripting.jscript
Date: 2002-03-29 23:03:18 PST
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&th=49cbeb2c97fb90f3


Some of the links supplied by Michael Harris in this thread are changed, and
Google has removed a lot of underscores in the Michael Harris script. Here is a
corrected version with updated links and added underscores. Note that it will
only work on files placed on a NTFS partition, it will not work for files placed
on a FAT32 partition.

'=====
' Reference:
' ShellFolderItem.ExtendedProperty Method
'
http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/objects/shellfolderitem/extendedproperty.asp

'
' (supported on WinME/Win2000/XP)
'
' The Summary Information Property Set
'
http://msdn.microsoft.com/library/en-us/stg/stg/the_summary_information_property_set.asp

'
' The DocumentSummaryInformation and UserDefined Property Sets
'
http://msdn.microsoft.com/library/en-us/stg/stg/the_summary_information_property_set.asp

'=====

set shellApp = createobject("shell.application")

set oItem = shellApp.Namespace("c:\").parsename("test.txt")

arPropNames = array( _
"Title", _
"Subject", _
"Author", _
"Keywords", _
"Comments", _
"Template", _
"Last Saved", _
"Revision Number", _
"Total Editing", _
"Last Printed", _
"Create Time/Date", _
"Last Saved Time/Date", _
"Number of Pages", _
"Number of Words", _
"Number of Characters", _
"Thumbnail", _
"Name of Creating Application", _
"Security" _
)

for each propname in arPropNames
s = s & propname & "=" _
& oItem.ExtendedProperty(propname) & vbcrlf
next

msgbox s

--
torgeir


Teena

unread,
Aug 5, 2002, 3:34:41 PM8/5/02
to
Thank you very much, Torgeir.  Your helpful info was just what I needed to accomplish this script.  The script I was able to write based on the info you sent gives the name, version, date created, date last modified, path, and size of any file that has that info.  You really rock!  (8^D
0 new messages