Get Extended Properties of a file
8,369
Check out this link where James O'Neill creates a powershell script to get at any of the extended properties. He uses it to get at all the camera properties stored in a file, but Title is one of them.
Borrowing from Windows Explorer in PowerShell part 2: extended properties
The function:
function Get-ext
{param ($attributes, $Path=(pwd).path)
$objShell = New-Object -ComObject Shell.Application
$objFolder = $objShell.namespace($path)
0..266 | Foreach-object -begin {$Columns=@{} } -process {$Columns.add($objFolder.getDetailsOf($Null, $_),$_)}
foreach ($file in $objFolder.items()) { $attributes | forEach -begin {$fileObj = New-Object -TypeName System.Object } `
-process {Add-Member -inputObject $fileObj -MemberType NoteProperty -Name $_ ` -Value ($objFolder.GetDetailsOf($file , $Columns[$_]) )} `
-end { $fileObj} }
}
Calling the function:
Get-ext "name","Title","Tags","f-stop","Exposure Time","ISO Speed" | ft *
original url link left in for completeness
Related videos on Youtube
Author by
HtS
Updated on September 18, 2022Comments
-
HtS over 1 year
What's the fastest way to output the 'Title' property of all files in a directory in Windows 7? I tried
dir
in command line but that only prints the filename, not the Title found in the extended properties. Is there a fast way of iterating a directory (preferably via commandline or batch)?-
Moab about 12 yearsProbably can be done using PowerShell in Windows7, but have no clue how to get it done though....msdn.microsoft.com/en-us/library/windows/desktop/…
-
Iszi about 12 yearsSounds similar to a question I had awhile ago. I'll see if I can dig it up.
-
Iszi about 12 yearsHere. See if you can adapt some of the answers from this question to help: superuser.com/questions/363278/…
-
-
Dave over 10 yearsYou could easily copy the relevant content into your post. The problem with link only answers is links go bad! Copying content is absolutely fine providing it is cited (as it is). If you copy the content over, I'll remove my -1
-
MattV over 4 yearsUnfortunately the link doesn't work anymore
-
WireGuy over 4 years@MattV the link was moved to an archive, I have updated the link and kept the original link for reference and searching. And the code is now included.