How do I access “Details” (“Title”, “Subject”, etc.) of file properties in Perl or PowerShell script

為{幸葍}努か 提交于 2019-12-07 04:39:21

问题


If one looks at file properties in Windows Explorer, the "Details" tab, - for many filetypes (for example, tiff or jpeg images, Office documents, etc.) there is the "Description" section with fields like "Title", "Subject", "Tags", and "Comments". Is there a way to read/write these fields from Perl or a PowerShell script?


回答1:


PowerShell has gone through some iterations, and this can now be achieved with a native command: Get-ItemProperty

Example: Shows the current details of ntdll.dll file:

Get-ItemProperty C:\Windows\System32\ntdll.dll | format-list



回答2:


I wrote up a blog post on how to access extended properties a while back - as in when PowerShell was still in beta and called Microsoft Command Shell (MSH). :-) I think it's still a valid approach.



来源:https://stackoverflow.com/questions/12647054/how-do-i-access-details-title-subject-etc-of-file-properties-in-perl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!