Page 1 of 3 123 LastLast
Results 1 to 15 of 37
  1. #1
    3 Star Lounger
    Join Date
    Feb 2003
    Location
    Runcorn, Cheshire, United Kingdom
    Posts
    372
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Registry Check for Windows OS version

    A colleague is looking for a generic check he can make in the registry to determine the version of Windows he's using (95 or 98 or 98SE or ME or NT or 2000 or XP) .
    Is there a single place to look?

    His need is so that his code can decide whether it should be using printer A (if from win2000) or printer B (from win NT), but a general answer would be useful.

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    Cincinnati, Ohio, USA
    Posts
    7,089
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Registry Check for Windows OS version

    Yes, there is a place to check. The registry key

    HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionProductName

    contains the name of the version of Windows in use. I do not know if this exists under Win9x, though, and at the moment I have no means of checking.

    Hope that helps!
    -Mark

  3. #3
    Plutonium Lounger
    Join Date
    Oct 2001
    Location
    Lexington, Kentucky, USA
    Posts
    12,107
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Registry Check for Windows OS version

    You didn't say how you plan to do this check, but doesn't the VER command return the name and version number of the Windows version? I don't have too many versions available to me any more, but it does so in XP Pro and WinME.

  4. #4
    3 Star Lounger
    Join Date
    Feb 2003
    Location
    Runcorn, Cheshire, United Kingdom
    Posts
    372
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Registry Check for Windows OS version

    Hi Mark,
    I heard this was the case for XP, but I'm running NT 4 and I don't have any "ProductName" under that key.
    I do have a "CurrentVersion" (4), and a CurrentBuildNumber (1381), but nothing to say what actual product I'm using.

    Thanks for looking though.

    Owen

  5. #5
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Registry Check for Windows OS version

    If you chap is working with BATch files, he could extract what he wants out of the attached file...

    (Be warned that some of the later parts of the BATch file are me-specific, because I'm testing on three of my machines!)
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  6. #6
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Registry Check for Windows OS version

    NT4 *will* show "4.0" as the version number, and W2K (aka NT5) will show "5.0"

    (XP is really NT 5.1)

  7. #7
    Gold Lounger
    Join Date
    Feb 2003
    Location
    Wardrobe Malfunction Junction, Derry
    Posts
    2,953
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Registry Check for Windows OS version

    Places To Look Besides the Registry

    If you Start>run and in the run box or in the "activated address bar" rt. click task bar>tools>address bar (which then also becomes a run box as well as an address bar in your taskbar and put winver in either, an About Windows box should pop up. I've used this in some 98 boxes at the library, (at least the run box) so I would think it would work in XP. I can't make "ver" work in the run box curiously, but both of these will work in any other command line with the exception of the Recovery Console. I also find this on System Properties however of the many ways you want to get there (rt. click My Computer, Windows + Pause Break key; System on Control Panel or rt. click shortcutting the Control Panel Applet). You can also type "Msinfo32" in the run box or activated address bar and this will give you the version at the top of System Information but it will take several seconds longer to load.

    SMBP

  8. #8
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Registry Check for Windows OS version

    Further information here at Codeproject.com
    Interesting to see that Windows 95, 98 and ME are all classed as "Version 4" as well - I guess that was the next step after Win 3.1.....

  9. #9
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    Cincinnati, Ohio, USA
    Posts
    7,089
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Registry Check for Windows OS version

    For the NT family, only Windows 2000 and XP will return a product name. This way you can assume that a null is NT 4 or another flavor of Windows. Perhaps you can use it knowing that?
    -Mark

  10. #10
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Registry Check for Windows OS version

    Hmm. Pity nobody seems to have read my attachment...
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  11. #11
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Registry Check for Windows OS version

    Reading and comprehending are not necessarily the same thing <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  12. #12
    Uranium Lounger viking33's Avatar
    Join Date
    Jun 2002
    Location
    Cape Cod, Massachusetts, USA
    Posts
    6,308
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Registry Check for Windows OS version

    Just run Aida32 and it will tell all.
    No need to run regedit or a batch file or whatever. <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    Bob
    BOB
    http://lounge.windowssecrets.com/S/flags/USA.gif http://lounge.windowssecrets.com/S/f...sachusetts.gif


    Long ago, there was a time when men cursed and beat on the ground with sticks. It was called witchcraft.
    Today it is called golf!

  13. #13
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    Cincinnati, Ohio, USA
    Posts
    7,089
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Registry Check for Windows OS version

    Aye, AIDA will tell all, but from a programmatic standpoint, it does not provide the solution. I believe the goal is to be able to pull this information from within code.
    -Mark

  14. #14
    Uranium Lounger viking33's Avatar
    Join Date
    Jun 2002
    Location
    Cape Cod, Massachusetts, USA
    Posts
    6,308
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Registry Check for Windows OS version

    I suppose so, Mark.
    Why I don't know but he also said, "but a general answer would be useful."

    Always a few ways to get the same answer, it's just the route you take. <img src=/S/yep.gif border=0 alt=yep width=15 height=15>

    Bob
    BOB
    http://lounge.windowssecrets.com/S/flags/USA.gif http://lounge.windowssecrets.com/S/f...sachusetts.gif


    Long ago, there was a time when men cursed and beat on the ground with sticks. It was called witchcraft.
    Today it is called golf!

  15. #15
    Plutonium Lounger
    Join Date
    Oct 2001
    Location
    Lexington, Kentucky, USA
    Posts
    12,107
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Registry Check for Windows OS version

    Oh, you can bet the store on it - I DID! An ol' batch man like me, what else! I wuz gonna write back and tease you about - I knew you're good at this, John, but man that was some fast writing on your part! I'm only hoping the the OP will check out your contribution.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •