R.Wieser
2024-06-22 10:14:11 UTC
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
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