Windows Version Numbers

Scott Rossi scott at tactilemedia.com
Wed Aug 13 07:19:00 EDT 2003


I thought the following might prove helpful for folks doing version
detection on Windows...

Determining the current Windows version in Rev/MC may require a slight
change on the scripting side.  I've been doing a project with a client that
used a script similar to the following to detect the current system version:

switch the systemVersion
  case "Windows 4.0"
    put "Windows 95" into tVersion
    break
  case "Windows 4.10"
    put "Windows 98" into tVersion
    break
  case "Windows 4.90"
    put "Windows ME" into tVersion
    break
  case "NT 4.0"
    put "Windows NT" into tVersion
    break
  case "NT 5.0"
    put "Windows 2000" into tVersion
    break
  case "NT 5.1"
    put "Windows XP" into tVersion
end switch

After some testing, the client found that my project failed on some
variations of Windows 98 and Windows ME (the client has a fairly extensive
QA department).  Apparently these Windows variations return systemVersions
other than 4.10 and 4.90. The way I seemed to have solved the problem was to
compare number *ranges* in the systemVersion, instead of exact values:

put word 2 of the systemVersion into V
if word 1 of the systemVersion = "Windows" then
  switch
    case V>=4 and V<4.1
      put "Windows 95" into tVersion
      break
    case V>=4.1 and V<4.9
      put "Windows 98" into tVersion
      break
    case V>=4.9
      put "Windows ME" into tVersion
  end switch
else
  switch
    case V>=4 and V<5
      put "Windows NT" into tVersion
      break
    case V>=5 and V<5.1
      put "Windows 2000" into tVersion
      break
    case V>=5.1
      put "Windows XP" into tVersion
  end switch
end if

Hope this saves folks some debugging time.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com




More information about the metacard mailing list