13

Using the Powershell console, what command/commands can be executed to determine if the 32 or 64 bit bersion of Windows Server 2008 is installed?

Matt Spradley
  • 344
  • 1
  • 5
  • 12
  • Very similar to this question: http://serverfault.com/questions/27495/how-to-determine-whether-the-32-or-64-bit-version-of-windows-server-2008-is-insta – Kevin Kuphal Jun 17 '09 at 18:52
  • I see now you asked both :) The environment variable option given in your other question should be trivial to get from PowerShell. – Kevin Kuphal Jun 17 '09 at 18:53
  • Yes... I wanted a PowerShell solution as well and I decided it was better to break my 2 part question into 2 questions since everyone were only answering the first part. – Matt Spradley Jun 17 '09 at 21:18

7 Answers7

17

Or try this:

PS C:\Users\jeffh> $os=Get-WMIObject win32_operatingsystem
PS C:\Users\jeffh> $os.OSArchitecture
64-bit

Found at: http://msgoodies.blogspot.com/2008/05/is-this-powershell-session-32-bit-or-64.html

Jeffrey Hulten
  • 370
  • 1
  • 5
6

echo %PROCESSOR_ARCHITECTURE%

churnd
  • 4,077
  • 5
  • 34
  • 42
6

So be it:

[System.Environment]::Is64BitOperatingSystem
romu
  • 303
  • 1
  • 5
  • 11
4

"echo %PROCESSOR_ARCHITECTURE%" down-voted? Must not be powershelly enough, which is funny if you look at the other examples using WMI and other aliases.

oh well, try this:

($env:PROCESSOR_ARCHITECTURE -eq "AMD64")

EDIT - pointed out in the comment that this is not the version of windows, it's the arch. FWIW- It's not the "real" arch, it's what WOW64 is reporting to the app. But you are right... if it's x32 powershell, it'll say x86. Often times this will get you what you want but...

Either way, http://support.microsoft.com/kb/556009 is the registry location to the correct value, and here's a script.

Get-ChildItem HKLM:\HARDWARE\DESCRIPTION\System\CentralProcessor\ | Get-ItemProperty -Name Identifier | Select-Object -Property PSChildName,Identifier | ft -AutoSize
slipsec
  • 190
  • 2
  • 9
1

With PowerShell:

(gwmi win32_computersystem).SystemType

Source: http://www.sysadmit.com/2015/10/windows-como-saber-si-es-de-32-o-64-bits.html

  • That's the type of processor, not Windows bitness. [More Info:](https://msdn.microsoft.com/en-us/library/aa394102(v=vs.85).aspx) – John Homer Oct 09 '15 at 20:02
0

you may type in cmd "systeminfo" then easily you can detect about 32bit or 64bit

-1

I would assume you can just open a command prompt and type:

cd "C:\Program Files (x86)"

if you get somewhere, you got 64 bit.

MathewC
  • 6,957
  • 9
  • 39
  • 53