How to detect if Windows is running 32 or 64 bit from a command script: Difference between revisions

From Yggenyk
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 17: Line 17:
* [http://download.microsoft.com/download/5/d/6/5d6eaf2b-7ddf-476b-93dc-7cf0072878e6/32-64bit_install.doc Driver Installation for 32-bit and 64-bit Platforms]
* [http://download.microsoft.com/download/5/d/6/5d6eaf2b-7ddf-476b-93dc-7cf0072878e6/32-64bit_install.doc Driver Installation for 32-bit and 64-bit Platforms]


WOW64 Implementation Details - Environment Variables:
WOW64 Implementation details - Environment Variables:
* [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/win64/win64/wow64_implementation_details.asp WOW64 Implementation Details]
* [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/win64/win64/wow64_implementation_details.asp WOW64 Implementation Details]




<google>ENGELSK</google>
<google>ENGELSK</google>

Latest revision as of 14:06, 11 January 2008


This is the simple and safe way to detect if Windows is running 64 bit (x64) or 32 bit (x86).

@if /I "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
   echo We are running I a 64-bit process on a 64-bit OS
) else if /I "%PROCESSOR_ARCHITECTURE%" == "X86" (
   @if /I "%PROCESSOR_ARCHITEW6432%" == "AMD64" (
      echo We are running in a 32-bit process on a 64-bit OS (WOW64)
   ) else (
      echo We are running in a 32-bit process on a 32-bit OS
   )
)

This is documented in Microsoft's document:

WOW64 Implementation details - Environment Variables:


<google>ENGELSK</google>

id=siteTree