Windows Command to get all information/properties of a file

cmd.exewindows

Is there any command get all the properties of a file including its encoding format (this piece of information is really important to me) on Windows ? I'm looking for something similar to stat in Linux

I'd prefer using a command that can be used in command-prompt or a batch script although I know its possible with Powershell.

Best Answer

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..