Just a simple script to determine the windows version.
You can call this from your own scripts. It sets three variables, win_v, win_v_name, and win_v_build. win-v is the version number #.#. win_v_name is the name of the operating system in a string. win_v_build is the build number.
Feel free to modify this any way you like or just copy/paste it to your own script. Your welcome. :)