Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how can you identify if an OS is 32 or 64 bit

Posted on 2011-03-25
11
Medium Priority
?
449 Views
Last Modified: 2012-05-11
is there a simple means to find the bit size of an os using a script.
0
Comment
Question by:Hilarosrags
11 Comments
 
LVL 14

Expert Comment

by:bmsjeff
ID: 35218499
xp or windows 7?
0
 
LVL 13

Expert Comment

by:JeremySBrown
ID: 35218515
If you right click "Computer" and select "Properties" under System type it will tell you if it's a 64-bit or 32-bit OS. 32-bit is also known as x86.
0
 
LVL 14

Expert Comment

by:bmsjeff
ID: 35218518
Windows 7
Right click on My computer
Click on Properties
Dialogue box will tell you under "System Type"
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:bmsjeff
ID: 35218527
XP
Click Start, and then click Run.
Type sysdm.cpl, and then click OK.
Click the General tab. The operating system is displayed as follows:
For a 64-bit version operating system: Windows XP Professional x64 Edition Version < Year> appears under System.
For a 32-bit version operating system: Windows XP Professional Version <Year> appears under System.
0
 
LVL 59

Expert Comment

by:Darius Ghassem
ID: 35218567
Go to Start Run the type msinfo32 this will bring up the information if you look at System Type this will show you.
0
 
LVL 12

Expert Comment

by:ibrahim52
ID: 35218640
If you are looking for scripts and not for command than please visit the link below. Good luck

Referred Link :
http://www.vistax64.com/vb-script/223713-how-find-operating-system-bit-x86-x64-ia64-2.html
0
 
LVL 5

Accepted Solution

by:
TomasP earned 1800 total points
ID: 35218896
since you stated that the solution should be script based, this is what MS recommends as one of the ways to determine bitness of the installed Windows

 
@echo off
 
Set RegQry=HKLM\Hardware\Description\System\CentralProcessor\0
 
REG.exe Query %RegQry% > checkOS.txt
 
Find /i "x86" < CheckOS.txt > StringCheck.txt
 
If %ERRORLEVEL% == 0 (
    Echo "This is 32 Bit Operating system"
) ELSE (
    Echo "This is 64 Bit Operating System"
)
0
 
LVL 16

Assisted Solution

by:cantoris
cantoris earned 100 total points
ID: 35219675
wmic cpu get addresswidth
Returns 32 or 64.  I'm not sure what this returns from a 64-bit capable CPU running a 32-bit OS.

wmic computersystem get systemtype
Is perhaps another to look into?  eg it returns "x64-based PC" on my machine.

Attached is some VBScript based on the first possibility.
strHostname = "."
Set objSWbemServices = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strHostname & "\root\cimv2")
strWQL = "SELECT AddressWidth FROM Win32_Processor"
Set colCPUs = objSWbemServices.ExecQuery(strWQL)
For Each objCPU In colCPUs
  intWidth = objCPU.AddressWidth
  If intWidth = 32 Then
    WScript.Echo strHostname & " is 32-bit."
  Else
    WScript.Echo strHostname & " is 64-bit."
  End If
Next

Open in new window

0
 
LVL 4

Assisted Solution

by:FireW0lf
FireW0lf earned 100 total points
ID: 35231137
The question was to get this via a script

So, open a CMD prompt, and type this:
echo %processor_architecture%

Open in new window


32 bit shows "x86"
64 bit shows "AMD64" (on my AMD 64 bit Servers), or "IA64", etc

If you want to save this to a file, then simply echo %processor_architecture% > C:\CPU.txt
0
 
LVL 16

Expert Comment

by:cantoris
ID: 35231437
It depends what script language is being referred to of course.

In VBScript, you could make use of FireW0lf's suggestion like this:
 
Set objWshShell = WScript.CreateObject("WScript.Shell")
strCPUType = objWshShell.ExpandEnvironmentStrings("%Processor_Architecture%")
WScript.Echo "CPU type is " & strCPUType

Open in new window


That environment variable also returns "AMD64" on a non-Itanium Intel Processor that supports 64 bit.
0
 

Author Closing Comment

by:Hilarosrags
ID: 35231841
thanks everyone for your quick, accurate answers
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IF you are either unfamiliar with rootkits, or want to know more about them, read on ....
Unable to change the program that handles the scan event from a network attached Canon/Brother printer/scanner. This means you'll always have to choose which program handles this action, e.g. ControlCenter4 (in the case of a Brother).
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question