1

Possible Duplicate:
How to check if a binary is 32 or 64 bit on Windows?

In Windows 7, applications should be installed to "Program Files" or "Program Files (x86)" depending on whether they are 64-bit or 32-bit (respectively, as per this page).

Is there an easy way to check that all the applications on my system are in the correct Program Files directory?

To put it another way, is an easy way to detect any 32-bit applications in "Program Files" and 64-bit applications in "Program Files (x86)"?

Anon Gordon
  • 383
  • 2
  • 4
  • 13

1 Answers1

0

You can use the file command line utility. Basically, you invoke the command in a terminal and give it filenames as arguments. Like this:

$ file "Program Files (x86)/QuickTime/QTSystem/ExportController.exe"
Program Files (x86)/QuickTime/QTSystem/ExportController.exe: PE32 executable (GUI) Intel 80386, for MS Windows

$ file Program\ Files/CCleaner/*exe
Program Files/CCleaner/CCleaner64.exe: PE32+ executable (GUI) x86-64, for MS Windows
Program Files/CCleaner/CCleaner.exe:   PE32 executable (GUI) Intel 80386, for MS Windows
Program Files/CCleaner/uninst.exe:     PE32 executable (GUI) Intel 80386, for MS Windows, Nullsoft Installer self-extracting archive

If you know some Python or even Java, it should be relatively easy to run the command from within an application and test whether a given binary is this or that.

Apparently, there is a windows port here: http://gnuwin32.sourceforge.net/packages/file.htm

Another alternative, is of course Cygwin, with the added benefits of a bash shell.