How To Check If Computer Is Running A 32 Bit or 64 Bit OS

12 10 2009

Description

 

 

How to check if our computer is running a 32 bit or 64 bit operating system.

HowCanIDoIt1

 

 

There are different methods to check the OS

Method 1:

Click Start, then click on Run
Type msinfo32.exe and click enter key
In System Information check the value of System Type
For 32-bit editions of Windows, the value of the System Type item is x86-based PC.
For 64-bit editions of Windows, the value of the System Type item is x64-based PC.

Method 2:

Otherwise you can use the following registry location to check it.
HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor

 Just check the Identifier value.
If its x86, indicates the 32 bit and x64 indicates the 64 bit OS.

Method 3:

C++  code to check the processor.

A 32-bit application can detect whether its running under WOW64 by caling the IsWow64Process function. 

BOOL Is64BitOS()
{
   BOOL bIs64BitOS = FALSE;

   // We check if the OS is 64 Bit
   typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); 

   LPFN_ISWOW64PROCESS
      fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(
      GetModuleHandle("kernel32"),"IsWow64Process");
 
   if (NULL != fnIsWow64Process)
   {
      if (!fnIsWow64Process(GetCurrentProcess(),&bIs64BitOS))
      {
         //error
      }
   }
   return bIs64BitOS;
}
BOOL Is64BitOS()
{
BOOL bIs64BitOS = FALSE;
// We check if the OS is 64 Bit
typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
LPFN_ISWOW64PROCESS
fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(
GetModuleHandle(“kernel32″),”IsWow64Process”);
if (NULL != fnIsWow64Process)
{
if (!fnIsWow64Process(GetCurrentProcess(),&bIs64BitOS))
{
//error
}
}
return bIs64BitOS;
}