Loading ...
Sorry, an error occurred while loading the content.

12592Re: [Clip] Where Do I Find What Version of Windows?...

Expand Messages
  • Larry Hamilton
    Oct 11, 2004
    • 0 Attachment

      Here is a clip I started a couple of years ago.

      At least as a "data pack rat" my wife cannot complain about all the junk
      lying around! ;-)

      It at least shows where the version information is located for the 9x
      and NT variations of Windows. This one is hard-coded to do Windows NT
      variations, since that is the PC I was using. This should at least get
      you started. I recall it took me a few hours of Googling to track this
      down. I found a lot of information at sites for C++ coding. I would like
      to know how to find the SP# if you find it.

      ---------< start clip >---------
      ;07/24/2002 Larry Hamilton lmh@...
      ;Windows 95, 98 and Me:
      ;Windows NT, 2000 and XP:
      ;[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]

      ^!SetDebug ON
      ;----------------------[begin long line]---------------------------
      ;-----------------------[end long line]----------------------------
      ;----------------------[begin long line]---------------------------
      ;-----------------------[end long line]----------------------------
      ;----------------------[begin long line]---------------------------
      ;-----------------------[end long line]----------------------------

      ;----------------------[begin long line]---------------------------
      ;^!Info ^$GetRegValue(HKEY_LOCAL_MACHINE\software\Microsoft\Windows
      ;-----------------------[end long line]----------------------------
      ^!Info ^%ProductName% ^%CurrentVersion% ^%CurrentType%
      ---------< end clip >-----------

      Here is a VBScript file I was working on at that time and it shows what
      version of Windows each number equals. I think this is a modification of
      something I found online, but I do not see any links. I do not have any
      notes on service packs though, but I am sure it must be in the registry

      <Copy Below This Line - NOTE: The single quote/apostrophe is a VBS comment.>
      '07/24/2002 Larry Hamilton lmh@...
      'Windows 95, 98 and Me:
      'Windows NT, 2000 and XP:
      '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]

      Option Explicit:Dim ws, t, p1, p2, n, g, q, cn, cg
      Set ws = WScript.CreateObject("WScript.Shell")
      t = "View Windows Version Utility"
      p1 = "HKLM\Software\Microsoft\Windows NT\CurrentVersion\"
      n = ws.RegRead(p1 & "ProductName")
      g = ws.RegRead(p1 & "CurrentVersion")
      q = ws.RegRead(p1 & "CurrentType")
      'cn = InputBox("Product Name", t, n)
      'cg = InputBox("Version", t, g)

      WScript.Echo "ProductName: " & n
      'If g > 5.0 Then 'Windows 2000 Test
      If g > 4.9 Then
      ' WScript.Echo "CurrentVersion: " & g & " Not Supported"
      WScript.Echo "CurrentVersion: " & n & " Not Supported"
      WScript.Echo "CurrentVersion: " & g
      End If
      WScript.Echo "CurrentType: " & q
      'WScript.Echo WshShell.RegRead("HKLM\Microsoft\software\Windows
      'WScript.Echo WshShell.RegRead("HKLM\Microsoft\software\Windows
      'WScript.Echo WshShell.RegRead("HKLM\Microsoft\software\Windows


      'Windows Versions:
      'Windows 9x versions:
      '4.0.950 Windows 95
      '4.0.1111 Windows 95 OSR 2 & 2.1
      '4.0.1212 Windows 95 OSR 2.5
      '4.1.1998 Windows 98
      '4.1.2222 Windows 98 Second Edition
      '4.9.3000 Windows ME

      'Windows NT versions:
      '3.51.1057 Windows NT 3.51
      '4.0.1381 Windows NT 4.0
      '5.0.2195 Windows 2000
      '5.01.2600 Windows XP

      <Copy Above This Line>

      Larry Hamilton
      My Webpage

      Jody wrote:
      > Hi All,
      > Where do I look to find what version of Windows is installed on a
      > computer and preferably the SP number? I need to use a Clip to do
      > it. If it is in the registry it cannot be a binary entry. I would
      > hope that is where I look instead of guessing a file dates. <g>
      > It would be something like the following. I can build the Clip; I just
      > need to know where to look. ^$ExpandEnv("Str")$ doesn't find it, but
      > it looked kind of good until it returned Windows_NT for my XP SP2.
      > ^$GetRegValue("[BaseRoot\]Key[:Name]")$ (added in v4.8)
      > Returns the value stored under the specified key in the Windows
      > Registry. If BaseRoot is not defined, then HKEY_CURRENT_USER is
      > used. If no value is specified for Name, the "(Default)" name is
      > used. Returns an empty string if the key does not exist. Example:
      > ^$GetRegValue(HKEY_CURRENT_USER\Software\Beta:UserName)$ -> Raymond
      > ^$GetRegValue(Control Panel\International:sDate)$ -> /
      > ^$GetRegValue(HKEY_CLASSES_ROOT\.386)$ -> vxdfile
      > Version 4.83: if the Key value contains a colon, the Clip
      > interpreter will incorrectly assume it marks the limit between the
      > Key and Name elements. To remedy this situation, use a double
      > colon after the key name. Example:
      > ^$GetRegValue(HKEY_CURRENT_USER\Software\c:Temp::Folder)$
      > Thanks!
      > Jody
      > ...he that is of a merry heart hath a continual feast...
      > http://www.clean-funnies.com
      > See ya in the funnies!
      > http://www.purewords.org/sojourner
      > http://www.sojourner.us/software
      > notetab.net, fookes.us
    • Show all 17 messages in this topic