What's the command line to find out if the OS is running a 32-bit version or 64-bit of Windows?

link|improve this question
In what language?! – Alix Axel Jan 15 '10 at 5:30
feedback

migrated from stackoverflow.com Jan 15 '10 at 5:39

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

7 Answers

You can get this via WMI:

wmic OS get OSArchitecture

Example on my system:

C:\>wmic OS get OSArchitecture
OSArchitecture
32-bit
link|improve this answer
I like this answer (gotta go learn me some WMI console :) ), but I gotta give it to "systeminfo" for keystrokes. ;) – techie007 Jan 15 '10 at 5:45
feedback

Command line:

systeminfo | findstr type:

example output:

System type:               X86-based PC

X86 indicates a 32-bit system in this example.

link|improve this answer
I gave you a point for keystrokes, and then you made it longer. hehe :) – techie007 Jan 15 '10 at 6:10
It's not my answer :P – John T Jan 15 '10 at 6:19
1  
But is "X86-based PC" the same as OSArchitecture 32-bit? You can run 32-bit Win XP on an x64 processor. – Michael Caron Mar 27 at 15:52
feedback

Regular command line: wmic OS get OSArchitecture (IIRC)

PowerShell: (gwmi win32_computersystem).SystemType

link|improve this answer
feedback

I can not attach answer to another post so here. Piping the result of systeminfo - is taking a quite good amount in time and writes to the console so is not the best solution for command files (batch scripts - anyhow You like to call them B-) ).

Even with the findstr - it does not find this on other language version of windows. On a central european language win7 os it also returns ..."X86-based"... on the result but something other on then the "type" were looking for. I am not sure that it can vary on other language variants of the os.

Probably the "wmic" method is the most reliable - it asks the os directly.

Other possible quick solution can be to examine a variable (at least working on win7 at me).

echo %PROCESSOR_ARCHITECTURE%

Ok - it is quite long to remember but possible a set | findstr ARCH can be remembered.

Sure - some can modify a system variable so not that reliable than wmic. But can be used quickly.

I hope I could help someone out.

link|improve this answer
I wasn't sure the echo command would work on my XP box because I've never seen this environment variable before (perhaps because I've never looked for it), but it does. +1 for a simple solution. – music2myear Oct 20 '11 at 15:58
feedback

if you are referring to windows OS, you can use vbscript with WMI

strComputer = "."    
Set objWMIService = GetObject("winmgmts{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" & strComputer & "\root\cimv2")    
Set colSettings = objWMIService.ExecQuery("SELECT * FROM Win32_Processor")

For Each objProcessor In colSettings
Wscript.Echo "System Type: " & objProcessor.Architecture
Wscript.Echo "Processor: " & objProcessor.Description
Wscript.Echo "Address Width: "& objProcessor.AddressWidth
Next
link|improve this answer
feedback

You can find that Information using "System Information"

Start-> Run -> winmsd.exe

Under "System Summary"/ System Type you can find the OS version

X64 -> 64 Bit
X86 -> 32 Bit

JohnT's answer in GUI ;)

link|improve this answer
feedback

Go to Start ยป Run and then type cmd. Now you will be in command prompt. There you can type systeminfo and then press enter. It takes a few seconds to get all your system information. You can find the processor data too.

 Processor(s):              1 Processor(s) Installed.
                           [01]: x86 Family 15 Model 4 Stepping 10 GenuineIntel
  • x86 Family means, your processor is 32-bit.
  • x64 Family means, your processor is 64-bit.

C:\Documents and Settings\mr85464>systeminfo

OS Name:                   Microsoft Windows XP Professional
OS Version:                5.1.2600 Service Pack 3 Build 2600
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Member Workstation
OS Build Type:             Multiprocessor Free
Product ID:                76487-640-3658033-23932
Original Install Date:     3/16/2012, 2:03:44 PM
System Up Time:            5 Days, 21 Hours, 35 Minutes, 51 Seconds
System Manufacturer:       Dell Inc.
System Model:              OptiPlex 210L
System type:               X86-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: x86 Family 15 Model 4 Stepping 10 GenuineIntel
~2992 Mhz
link|improve this answer
feedback

Your Answer

 
or
required, but never shown