Results 1 to 9 of 9

Thread: Determine OS version and bit type from the registry

  1. #1
    RobM Guest

    Determine OS version and bit type from the registry

    Hi,

    I need to find out if there is a way to determine the operating system
    version and whether it is 32 or 64-bit by using the registry. I am aware of
    the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
    NT\CurrentVersion\CurrentVersion. Windows XP would be 5.1 and Vista would be
    6.0. I noticed that both the 32 and 64 bit versions are set to version 6.0.
    Does anyone know where to find the bit version installed in the registry?
    System Information is able to tell so it must be in the registry somewhere.

    I have been searching the internet for awhile without much luck so far.

    --

    Thanks,

    Rob

  2. #2
    Mark L. Ferguson Guest

    Re: Determine OS version and bit type from the registry

    --OS Architecture.VBS--cut here--
    ' Mark L. Ferguson 2008
    ' script to detect 32 or 64 bit architecture
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" _
    & strComputer & "\root\cimv2")
    Set colOperatingSystems = objWMIService.ExecQuery _
    ("Select * from Win32_OperatingSystem")
    For Each objOperatingSystem in colOperatingSystems
    Wscript.Echo objOperatingSystem.Caption & _
    " " & objOperatingSystem.OSArchitecture
    Next
    --end file--cut here--

    --
    Use the "Ratings" feature. It helps the new users.
    Please use the Communities guidelines when posting.
    http://www.microsoft.com/wn3/locales...help_en-us.htm
    Mark L. Ferguson MS-MVP
    https://mvp.support.microsoft.com/profile/Mark.Ferguson

  3. #3
    RobM Guest

    Re: Determine OS version and bit type from the registry

    I get an error message using this code:

    Line 8
    Char 5

    Error: Object doesn't support this property or method:
    'objOperatingSystem.OSArchitecture'

    Will this script tell me the bit version of the OS installed or only if the
    processor supports it? I'm looking for the bit version of the OS installed.

  4. #4
    PaulM Guest

    Re: Determine OS version and bit type from the registry

    Go here line 14 and download the script and run it.
    http://www.paulsxp.com/tweaksvista.html

    --
    Paul's XP and Vista Tweaks
    ---------------------------------------
    www.paulsxp.com

    Paul's XP and Vista Help Forum
    --------------------------------------------
    www.paulsxp.com/forum

    Live Support
    ------------------
    www.paulsxp.com/livesupport.html

  5. #5
    RobM Guest

    Re: Determine OS version and bit type from the registry

    One last question. You are making the determination by using the key
    HKLM\SYSTEM\CurrentControlSet\Control\Session
    Manager\Environment\PROCESSOR_ARCHITECTURE. Doesn't this refer to the
    processor's capability rather than the OS bit version?

    If you install a 32-bit OS on a processor capable of supporting 64-bit, the
    value at that key will still be x86 regardless of the processor?

    Sorry to drag this on but the Processor_Architecture key makes this a little
    confusing.
    --

  6. #6
    Darrell Gorter[MSFT] Guest

    Re: Determine OS version and bit type from the registry

    Hello Rob,
    The Processor_Architecture should show the OS platform
    The Processor_Identifier shows the hardware of the chip that is installed.

  7. #7
    RobM Guest

    Re: Determine OS version and bit type from the registry

    Ok, that answers all of my questions. Thank you to everyone that helped on
    this! It is very much appreciated!

  8. #8
    RobM Guest

    Re: Determine OS version and bit type from the registry

    Just for the record, I just found out that there is an environment variable
    assigned for this purpose. If you use %Processor_Architecture%, that will
    also get the information I was looking for. I could just as easily use this
    for my purpose as looking in the registry.

  9. #9
    Darrell Gorter[MSFT] Guest

    Re: Determine OS version and bit type from the registry

    Hello Rob,
    Note about using the environment variable to be aware of.
    This will change depending on whether you are running the 64-bit cmd prompt
    or the wow64 (32-bit) cmd prompt.
    If you run the 64-bit \windows\system32\CMD.exe you will get AMD64
    If you run 32-bit \windows\syswow64\cmd.exe you will get x86.

Similar Threads

  1. How to determine the ppm file type?
    By hanni ball in forum Windows Software
    Replies: 2
    Last Post: 05-01-2012, 06:08 PM
  2. Replies: 3
    Last Post: 12-01-2011, 02:20 AM
  3. How to determine the version of Web Objects?
    By D_chapple in forum Operating Systems
    Replies: 3
    Last Post: 23-11-2009, 09:51 PM
  4. How to determine type of video-card?
    By Claudius in forum Monitor & Video Cards
    Replies: 3
    Last Post: 13-03-2009, 03:18 PM
  5. MRxSmb - The redirector failed to determine the connection type
    By Steve White in forum Windows Server Help
    Replies: 1
    Last Post: 14-01-2009, 08:45 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,717,383,920.56648 seconds with 16 queries