By the way, the current build number is just that, a number. So the script maps these numbers to friendly OS version names (2195 = Windows 2000, 3790=Windows 2003, etc). As new versions of Windows come out, launch regedit, look at the build number, and add it to the list.
There's a lot more to accessing the registry than this script demonstrates. For one thing, we're reading string values. There's other registry data types like dwords, multi's and binaries that require some further demonstration, but I'll get to that in another post.