Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Jul 4 '11 at 1:44

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

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

2 Answers 2

up vote 11 down vote accepted

http://msdn.microsoft.com/en-us/library/aa384274.aspx

  • 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
2  
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 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.