Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - How to check if the OS is 64 bit or 32 bit?

Reply
 
Old 01-13-2009   #1 (permalink)
Gugle


 
 

How to check if the OS is 64 bit or 32 bit?

Hi all,
I want to check if the OS is 64 bit or 32 bit using vbscript. I'm
currently reading the registry key - HKEY_LOCAL_MACHINE\SYSTEM
\CurrentControlSet\Control\Session Manager\Environment
\PROCESSOR_ARCHITECTURE and checking the architecture. My question is
- Will this return the architecture of the OS or the architecture of
the processor? i.e., if a 32-bit Windows OS is installed on 64 bit
Processor, what will this return?

Thanks in advance for your help!

My System SpecsSystem Spec
Old 01-13-2009   #2 (permalink)
Richard Mueller [MVP]


 
 

Re: How to check if the OS is 64 bit or 32 bit?


"Gugle" <gugle.rulez@xxxxxx> wrote in message
news:86d06b46-12bb-47b5-b8cc-57d0389f1643@xxxxxx
Quote:

> Hi all,
> I want to check if the OS is 64 bit or 32 bit using vbscript. I'm
> currently reading the registry key - HKEY_LOCAL_MACHINE\SYSTEM
> \CurrentControlSet\Control\Session Manager\Environment
> \PROCESSOR_ARCHITECTURE and checking the architecture. My question is
> - Will this return the architecture of the OS or the architecture of
> the processor? i.e., if a 32-bit Windows OS is installed on 64 bit
> Processor, what will this return?
>
> Thanks in advance for your help!
Mine shows "x86" or that registry setting. I have AMD Turion 64 X2 TL-56
with 32-bit Vista.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Old 01-13-2009   #3 (permalink)
Richard Mueller [MVP]


 
 

Re: How to check if the OS is 64 bit or 32 bit?


"Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in
message news:uiupR6ZdJHA.1528@xxxxxx
Quote:

>
> "Gugle" <gugle.rulez@xxxxxx> wrote in message
> news:86d06b46-12bb-47b5-b8cc-57d0389f1643@xxxxxx
Quote:

>> Hi all,
>> I want to check if the OS is 64 bit or 32 bit using vbscript. I'm
>> currently reading the registry key - HKEY_LOCAL_MACHINE\SYSTEM
>> \CurrentControlSet\Control\Session Manager\Environment
>> \PROCESSOR_ARCHITECTURE and checking the architecture. My question is
>> - Will this return the architecture of the OS or the architecture of
>> the processor? i.e., if a 32-bit Windows OS is installed on 64 bit
>> Processor, what will this return?
>>
>> Thanks in advance for your help!
>
> Mine shows "x86" or that registry setting. I have AMD Turion 64 X2 TL-56
> with 32-bit Vista.
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab - http://www.rlmueller.net
> --
>
You should be able to use the Win32_Processor class of WMI. For example:
===========
Option Explicit

Dim strComputer, objWMIService, colSettings, objProcessor

strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" _
& strComputer & "\root\cimv2")

Set colSettings = objWMIService.ExecQuery _
("SELECT * FROM Win32_Processor")

For Each objProcessor In colSettings
Wscript.Echo "System Type: " & objProcessor.Architecture
Wscript.Echo "Processor: " & objProcessor.Description
Next
======
You can parse objProcessor.Description for "x64" to check for 64-bit (or
"x86" for 32-bit). The system type (objProcessor.Architure) returns 9 on my
machine, but I need to research what the number means.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Old 01-14-2009   #4 (permalink)
Gugle


 
 

Re: How to check if the OS is 64 bit or 32 bit?

On Jan 13, 9:57*pm, "Richard Mueller [MVP]" <rlmueller-
nos...@xxxxxx> wrote:
Quote:

> "Richard Mueller [MVP]" <rlmueller-nos...@xxxxxx> wrote in
> messagenews:uiupR6ZdJHA.1528@xxxxxx
>
>
>
>
>
Quote:

> > "Gugle" <gugle.ru...@xxxxxx> wrote in message
> >news:86d06b46-12bb-47b5-b8cc-57d0389f1643@xxxxxx
Quote:

> >> Hi all,
> >> I want to check if the OS is 64 bit or 32 bit using vbscript. I'm
> >> currently reading the registry key - HKEY_LOCAL_MACHINE\SYSTEM
> >> \CurrentControlSet\Control\Session Manager\Environment
> >> \PROCESSOR_ARCHITECTURE and checking the architecture. My question is
> >> - Will this return the architecture of the OS or the architecture of
> >> the processor? i.e., if a 32-bit Windows OS is installed on 64 bit
> >> Processor, what will this return?
>
Quote:
Quote:

> >> Thanks in advance for your help!
>
Quote:

> > Mine shows "x86" or that registry setting. I have AMD Turion 64 X2 TL-56
> > with 32-bit Vista.
>
Quote:

> > --
> > Richard Mueller
> > MVP Directory Services
> > Hilltop Lab -http://www.rlmueller.net
> > --
>
> You should be able to use the Win32_Processor class of WMI. For example:
> ===========
> Option Explicit
>
> Dim strComputer, objWMIService, colSettings, objProcessor
>
> strComputer = "."
>
> Set objWMIService = GetObject("winmgmts:" _
> * * & "{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" _
> * * & strComputer & "\root\cimv2")
>
> Set colSettings = objWMIService.ExecQuery _
> * * ("SELECT * FROM Win32_Processor")
>
> For Each objProcessor In colSettings
> * * Wscript.Echo "System Type: " & objProcessor.Architecture
> * * Wscript.Echo "Processor: " & objProcessor.Description
> Next
> ======
> You can parse objProcessor.Description for "x64" to check for 64-bit (or
> "x86" for 32-bit). The system type (objProcessor.Architure) returns 9 on my
> machine, but I need to research what the number means.
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab -http://www.rlmueller.net
> --
Thanx a ton Richard! That was really helpful.
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
spell check wont check english/ Vista mail
Anyone know how to fix/check WU? Windows Updates
You really need to check this out PowerShell
check this out Vista General
Newbie: Nagios with nrpe_nt, check for diskspace; check services,returncode PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46