Skip to content

Instantly share code, notes, and snippets.

@jasonreiche
Last active July 11, 2020 05:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonreiche/e719a3574ef67f947e82dd13516fbdf5 to your computer and use it in GitHub Desktop.
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
'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