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
Sigcheck from Sysinternals can gather most/all of this info for you.
You can use WMI datafile for this. Note that the name requires escaping the slashes.
The result looks like:
If you're trying to get file versions to figure out installed KBs, you can also use:
WMI also has built-in ability to run on remote machines.
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
.