Windows Command to get all information/properties of a file

You can use WMIC feature to do that.

For example :

F:>> wmic datafile where Name="anyfile.txt"

to get all information about anyfile.txt. You can use CMD and powershell too to using WMIC. And you can use GET parameter to get a specified information.

For Example:

F:>> wmic datafile where Name="F:\\ekojs.txt" get Description,Path,Status,Version

EDIT : Try using this before to check the WMIC functionality :

F:>> wmic datafile /?

To get a help how to using it.

Command :

wmic datafile where Name="F:\\ekojs.txt" get Description,Name,FileType >> eko_wmic.txt

Output in eko_wmic.txt:

Description   FileType       Name          
f:\ekojs.txt  Text Document  f:\ekojs.txt  

Hope this'll help you out..


To build on the previous answer. You can use wmic datafile to get info about a file, but you have to provide the full path and double-up your slashes like so

wmic datafile where Name="F:\\anyfile.txt"

This gives an unreadable mess in the console, as you'll see:

what a great way to render data, wmic

However if you pipe this into a text file, it's pretty legible

wmic datafile where Name="F:\\anyfile.txt" >> fileprops.txt

enter image description here

Fortunately, wmic can format the info as a list, and then it is actually pretty useful.

wmic datafile where Name="F:\\anyfile.txt" list /format:list

enter image description here

You can then provide these properties only for a simplified view, note that you must remove the list keyword.

>wmic datafile where Name="G:\\ipcamera.log" get Hidden,FileSize,Name  /format:list


FileSize=20
Hidden=FALSE
Name=G:\ipcamera.log

A little piece of trivia, wmic was the foundation for what eventually became PowerShell!