2

Is there a way to query the file details from a Windows CMD prompt? Looking for a way to query information from the "Details" tab of the file properties...

enter image description here

I can query other information from within this Details tab (like version) using WMIC, but the "Product name" seems to be elusive. Thanks in advance.

3 Answers3

3

The PowerShell cmdlet Get-ItemProperty would list the properties you're looking for.

The Specific property you're looking for is the VersionInfo Property.

Here an example where I ran it on an exe file (you also need | fl * to see everything):

PS C:\WINDOWS\system32> get-itemproperty "C:\Path\PDFX4.exe" | fl *

PSPath : Microsoft.PowerShell.Core\FileSystem::Z:\Software\i-p\PDF-XChange Pro\PDFX4 pro\PDFX4.exe PSParentPath : Microsoft.PowerShell.Core\FileSystem::Z:\Software\i-p\PDF-XChange Pro\PDFX4 pro PSChildName : PDFX4.exe PSDrive : Z PSProvider : Microsoft.PowerShell.Core\FileSystem Mode : -a---- VersionInfo : File: Z:\Software\i-p\PDF-XChange Pro\PDFX4 pro\PDFX4.exe InternalName: OriginalFilename: FileVersion: 4.188.188.0 FileDescription: PDF-XChange 4 Pro Product: PDF-XChange 4 Pro ProductVersion: 4.188.188.0 Debug: False Patched: False PreRelease: False PrivateBuild: False SpecialBuild: False Language: Sprachneutral

BaseName : PDFX4 Target : LinkType : Name : PDFX4.exe Length : 29597392 DirectoryName : Z:\Software\i-p\PDF-XChange Pro\PDFX4 pro Directory : Z:\Software\i-p\PDF-XChange Pro\PDFX4 pro IsReadOnly : False Exists : True FullName : Z:\Software\i-p\PDF-XChange Pro\PDFX4 pro\PDFX4.exe Extension : .exe CreationTime : 25.05.2020 23:19:32 CreationTimeUtc : 25.05.2020 21:19:32 LastAccessTime : 25.05.2020 23:19:32 LastAccessTimeUtc : 25.05.2020 21:19:32 LastWriteTime : 02.12.2010 08:32:41 LastWriteTimeUtc : 02.12.2010 07:32:41 Attributes : Archive

If you only want to see the VersionInfo you can use:

get-itemproperty "C:\Path\PDFX4.exe" | select VersionInfo | fl *
SimonS
  • 9,869
1

I would use Wmic from cmd:

wmic datafile where name="C:\\File\\Path\\Backslashes\\Doubled" get * /format:list

Or use Shell.Application in powershell:

$s=New-Object -com SHELL.application
$f=$s.namespace("FOLDER_PATH")
$f.getdetailsof($f.parsename("FILENAME_WITH _EXTENSION_NO_PATH"),NUMBER)
wasif
  • 9,176
0

With just Command, I do not think so.

But there definitely is a Powershell Cmdlet to do this

https://stackoverflow.com/questions/49214905/get-attributes-listed-in-the-details-tab-with-powershell

This script uses the Shell.Application object to get file metadata. It returns the metadata as a custom PowerShell object, and therefore can be sorted and otherwise processed. It is a bit slow because it checks all 266 possible fields for data for each file in the folder. I recommend that you store the results in a variable and then do your post processing of data after you have collected the objects. See the Hey Scripting Guy blog article from Feb. 5, 2014 for more information about this function.

Here is a Microsoft background article.

https://devblogs.microsoft.com/scripting/use-a-powershell-cmdlet-to-work-with-file-attributes/