Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.comp.os.windows-xp    |    Actually wasn't too bad for a M$-OS    |    17,273 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 16,931 of 17,273    |
|    JJ to R.Wieser    |
|    Re: vbscript: how to generate a FolderIt    |
|    23 Jun 24 00:52:57    |
   
   XPost: alt.windows7.general   
   From: jj4public@outlook.com   
      
   On Sat, 22 Jun 2024 12:14:11 +0200, R.Wieser wrote:   
   > 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.   
      
   "GetDetailsOf" is a method of "Folder". It's inherited to "Folder2" and   
   "Folder3". "Folder" is a base class of "Folder2", and "Folder2" is a base   
   class of "Folder3". So both "Folder3" is also "Folder2", and "Folder2" is   
   also "Folder".   
      
   "Folder"'s "GetDetailsOf" accepts "FolderItem". Not just "FolderItem2".   
      
   > 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 ?   
      
   Use "ParseName" method of the "Computer" folder. The folder which shows all   
   of the drives. e.g.   
      
   fullfilepath = "d:\dir\subdir\file.ext"   
   Set objDlg = WScript.CreateObject("Shell.Application")   
   Set oCompFolder = objDlg.NameSpace(17)   
   set oFile = oCompFolder.ParseName(fullfilepath)   
   set oFolder = oFile.GetFolder   
   sProperty = oNSFolder.GetDetailsOf(oFile, 16)   
      
   Not mentioned by MSDN:   
   Unless done from the "Computer" or "Network" folders, "ParseName" can only   
   accept file/folder name without any path (i.e. just the name and extension -   
   as seen in Explorer).   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca