Jump to content

A more up to date @OSVersion


Recommended Posts

I tried to post this to example scripts but I don't seem to have permission...

Anyway, for those of you using Windows 7, you probably already figured out that @OSVersion returns "WIN_VISTA" for both Vista and Win7. I wrote a quick function that returns the correct value. Enjoy!

Func OSVersion()
    If @OSVersion = "WIN_VISTA" Then
        $version = FileGetVersion(@SystemDir & "\WinVer.exe");
        If StringLeft($version,3) = "6.0" Then
            Return "WIN_VISTA"
        Else 
            Return "WIN_7"
        EndIf
    Else
        Return @OSVersion
    EndIf
EndFunc
Link to comment
Share on other sites

The problem is that Microsoft decided to give Windows 7 a version number of 6.1.xxxx

(You would think that Windows "7" would have a version number of "7"...)

I don't know why they did that but that's the reason I put 6.0 for Vista.

Looking at Version-Info of my XP (5.1.26...) this might be more accurate in the long run ^_^...

StringLeft($version,2) = "6."
Link to comment
Share on other sites

  • 1 month later...

The problem is that Microsoft decided to give Windows 7 a version number of 6.1.xxxx

(You would think that Windows "7" would have a version number of "7"...)

I don't know why they did that but that's the reason I put 6.0 for Vista.

They gave it a version of 6.1 because it is built on the same basic kernal as vista (6.0) they made changes to it, but it is not a rewrite, hence 6.1 and not 7.

7 will be the next major rewrite of the kernal.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...