How to detect if Windows is running 32 or 64 bit from a command script

From Yggenyk
Revision as of 14:00, 11 January 2008 by WikiSysop (talk | contribs)
Jump to navigation Jump to search
@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:

Yderligere dokumnetation:


<google>ENGELSK</google>

id=siteTree