In my limited Linux experience, I have always found the file command to be very useful. That may be partly because I was poking around in Linux most of the time to figure out what was what, but to have basic information about a file handy is as valid a need in Windows as it is in Linux or any other OS for that matter.

If you are a Windows command line user like I am or frequently check version info on binaries, it is easy to to get tired of switching to Windows Explorer (which on a bad day could take inexplicably long time before showing the main window) and navigate to the directory where the file exists and hover mouse over the file and wait for the popup that shows version information. One other way instead of hovering is to launch properties dialog and switch to the Details tab. Why do all that if my command line working directory is already where my file is ?

So I wrote a command line tool file to dump version and other file related information. file shows information which I hope will be useful to users, programmers and administrators. Here is a snapshot of file 1.4 in action.

file 1.4 sample output

You can quickly determine from BinaryType if an executable is 16-bit, 32-bit or 64-bit, from Attributes whether the file is compressed or encrypted, indexed or sparse, a reparse point or offline, from Type whether a file is a driver, font or VxD , from Timestamp when the binary was built (which is more reliable than file times), from CheckSum the binary checksum the linker put into it when it was built etc.  Characteristics and DllCharacteristics show other flags set on the binary. In this case I see that msisadrv.sys is not using SEH. 

file can be run in 32-bit and 64-bit Windows platforms. You can download latest version of file from downloads section here.

Tagged with →  
Share →

One Response to file – a tool to get file information from command line

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Looking for something?

Use the form below to search the site:


Still not finding what you're looking for? Drop us a note so we can take care of it!

Visit our friends!

A few highly recommended friends...

Set your Twitter account name in your settings to use the TwitterBar Section.