Yesterday we had the urgent need to check if a rather old executable file that we still use on one of our x64 Win2012 production servers to do some automation tasks was built for an x86 or x64 machine type. Normally you know that in advance, but the guy who originally built the file was no longer with us and both the file name and the folder wasn't clear about that.
The tool we did use to solve our issue was the great Sigcheck by SysInternals, which is available here for free.
Once downloaded and unpacked, using it is as simple as type the following in the command-prompt:
Which gives the following output:
Sigcheck v2.55 - File version and signature viewer
Copyright (C) 2004-2017 Mark Russinovich
Sysinternals - www.sysinternals.com
Signing date: 8:59 AM 8/22/2013
Prod version: 18.104.22.168
File version: 22.214.171.124
The latter line shows what we needed: 32-bit for x86 binaries, 64-bit for x64 ones.
In case you cannot download, unpack and/or execute such file, there are a lot of other techniques available to determine it, including looking at the file contents using a text editor/hex-editor: most of them are summarized in the following StackOverflow thread.
That's it for now: happy checking!