vbscript: how to generate a FolderItem2 object from a filename ?

"R.Wieser" <[email protected]>
Newsgroups alt.comp.os.windows-xp,alt.windows7.general
Organization A noiseless patient Spider
Message-ID <[email protected]>
Hello all,

I found a smal script which uses the "GetDetailsOf" method of a "Folder3" 
object to extract some properties of a file.

The thing is that the "GetDetailsOf" method expects a "FolderItem2" object 
as its first argument.

And although the "Folder3" object allows iterating thru its children by 
which it returns an "FolderItem2" object for each of its entries (files, 
subfolders), I would like to inspect just a single file.

So, I need a method to convert a (full) filename into a "FolderItem2" object 
(withor-without the aid of a "Folder3" object, which "GetDetailsOf" needs 
anyway).

Does what I'm looking for even exists ?  And if so, what does it look like ?

reference script:
- - - - - - - - - - - - - - - - - -
Set objDlg = WScript.CreateObject("Shell.Application")

'-- returns a Folder3 object
Set oNSFolder = objDlg.NameSpace(folderName)

'-- returns FolderItem2 objects
For Each oNSFile In oNSFolder.items

 '-- the "Artist" property value
  sProperty = oNSFolder.GetDetailsOf(oNSFile, 16)

  ...
next
- - - - - - - - - - - - - - - - - -

Regards,
Rudy Wieser
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.