Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm writing a batch script for windows 7 and want to handle both 64 bit and and x86 processors.

What are the possible values of the Windows %PROCESSOR_ARCHITECTURE% environment variable?

share|improve this question

migrated from Jul 4 '11 at 1:44

This question came from our site for professional and enthusiast programmers.

'migrated from stackoverflow' ... it's as if someone doesn't think that batch scripting is proper programming!? – Rory Jun 23 '14 at 16:17
up vote 16 down vote accepted

  • AMD64
  • IA64
  • x86

Note that this doesn't tell you the architecture of the processor but only of the process with the environment variable. It returns "x86" for a 32 bit process running on 64 bit Windows.

share|improve this answer
There's a workaround for the "32bit process on 64bit Windows" problem: just check PROCESSOR_ARCHITEW6432 as well, and if it isn't undefined (i.e. equals to AMD64 or IA64), then this is a 64bit machine. Source. – Olegs Jeremejevs Jan 23 '14 at 11:35

"EM64T" is also a possible value, however unlikely. My understanding is that you will only see this with XP-64.

share|improve this answer

You must log in to answer this question.