Last active
July 11, 2020 05:04
-
-
Save jasonreiche/e719a3574ef67f947e82dd13516fbdf5 to your computer and use it in GitHub Desktop.
Get all meta data from a file and put it in a Dictionary object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'objItem in this example would be a Scripting.FileSystemObject passed into a function | |
Dim objShell, objFolder, objFolderItem, objProps | |
Set objShell = CreateObject("Shell.Application") | |
Set objFolder = objShell.Namespace(objItem.ParentFolder.Path) ' File folder path without filename. | |
Set objFolderItem = objFolder.ParseName(objItem.Name) ' Filename without path. | |
set objProps = CreateObject("Scripting.Dictionary") | |
On Error Resume Next | |
For i = 0 To 512 | |
objProps.Add Trim(objFolder.GetDetailsOf(objFolder.Items, i)), Trim(objFolder.GetDetailsOf(objFolderItem, i)) | |
Next | |
' Usage | |
Const queryProp = "Frame width" | |
wscript.echo ": & objProps.Item("Frame width") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment