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?

link|improve this question

80% accept rate
Very similar to this question: serverfault.com/questions/27495/… – 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
feedback

4 Answers

up vote 8 down vote accepted

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

link|improve this answer
feedback

echo %PROCESSOR_ARCHITECTURE%

link|improve this answer
feedback

"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")
link|improve this answer
feedback

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.

link|improve this answer
That's not nearly reliable enough, I've seen software that installs to "C:\Program Files (x86)" on 32-bit Windows. – Graeme Donaldson Jun 18 '09 at 16:22
Ehh, true. Someone had already beat me to the best answer, so I figured I'd give the lazy one. – MathewC Jun 18 '09 at 18:06
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.