Solved

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

Posted on 2011-03-25
11
443 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 
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 450 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 25 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 25 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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
This article is a collection of issues that people face from time to time and possible solutions to those issues. I hope you enjoy reading it.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

739 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