Home » Questions » Computers [ Ask a new question ]

How can I determine if the current version of Windows is either 32-bit or 64-bit from the command line? [duplicate]

How can I determine if the current version of Windows is either 32-bit or 64-bit from the command line? [duplicate]

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

Asked by: Guest | Views: 83
Total answers/comments: 4
Guest [Entry]

"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."
Guest [Entry]

"Regular command line: wmic OS get OSArchitecture (IIRC)

PowerShell: (gwmi win32_computersystem).SystemType"
Guest [Entry]

"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"
Guest [Entry]

"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 ;)"