Solved

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

Posted on 2011-03-25
11
434 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The use of stolen credentials is a hot commodity this year allowing threat actors to move laterally within the network in order to avoid breach detection.
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now