3

Is there a way to query the details for an EXE file via command line? (existing Windows tool or PS, etc)

Specifically I would like to check the File version and Product version..

The GUI equivalent would be to right-click on a EXE file and going to the Details tab

0

2 Answers 2

4

Sigcheck from Sysinternals can gather most/all of this info for you.

> C:\Users\mfinnigan>sigcheck c:\windows\system32\acledit.dll
> 
> Sigcheck v1.92 - File version and signature viewer Copyright (C)
> 2004-2013 Mark Russinovich Sysinternals - www.sysinternals.com
> 

> c:\windows\system32\acledit.dll:
>         Verified:       Signed
>         Signing date:   11:17 PM 7/13/2009
>         Publisher:      Microsoft Windows
>         Description:    Access Control List Editor
>         Product:        Microsoft« Windows« Operating System
>         Version:        6.1.7600.16385
>         File version:   6.1.7600.16385 (win7_rtm.090713-1255)
2
  • That's pretty awesome! Thank you! You think I can run this remotely on many machines?
    – ToastMan
    Mar 13, 2015 at 21:55
  • I have no idea what your infrastructure is. Using a script, you could use PSExec or powershell remoting to run it against any arbitrary number of machines.
    – mfinni
    Mar 13, 2015 at 22:06
2

You can use WMI datafile for this. Note that the name requires escaping the slashes.

wmic datafile where name="C:\\windows\\system32\\kernel32.dll" get version

The result looks like:

Version
6.1.7601.18409

If you're trying to get file versions to figure out installed KBs, you can also use:

wmic qfe list

WMI also has built-in ability to run on remote machines.

wmic /node:otherhost /user:"domain\administrator" datafile where name="C:\\windows\\system32\\kernel32.dll" get version

You need to use your network administrator account or the machine's local administrator account. You can also pass in the password on the command line with /password:xyz.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .