Sign in to follow this  
Followers 0
staples

Windows 7 support

6 posts in this topic

@OSVersion detects WIN_VISTA

For this script I need to differenciate between vista and windows 7. I have searched the forums but have been unable to find a answer.

When will with @OSVersion be updated to display WIN_7?

Is there another way to detect Windows 7 that you use?

Share this post


Link to post
Share on other sites



You can use GetVersionEx (that's what autoit uses internally).

Do a search for GetVersionEx to get sample usage.


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

When will with @OSVersion be updated to display WIN_7?

It already has. The stable version doesn't have it sinse it came before Win7, but the latest betas will report "WIN_7" as expected.

Share this post


Link to post
Share on other sites

Take a look here...

http://www.autoitscript.com/forum/index.php?showtopic=93334&st=0&p=670497&hl=OSVersion%20vista&fromsearch=1&#entry670497

Share this post


Link to post
Share on other sites

Thank you everybody. I will check out all three avenues.

Share this post


Link to post
Share on other sites

I have been using this bit of code to assign the name of the OS to a variable that I can use elsewhere in my scripts.

Global $nOSversion = RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "CurrentVersion") ; Assign OS version number to variable

; Assign OS name to string variable depending on OS version number
Switch $nOSversion
    Case 6.1
        Global $sOSName = "Windows 7"
    Case 6.0
        Global $sOSName = "Windows Vista"
    Case 5.1
        Global $sOSName = "Windows XP"
    Case 5.0
        Global $sOSName = "Windows 2000"
    Case Else
        Global $sOSName = "Old Windows Version"
EndSwitch

Share this post


Link to post
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
Sign in to follow this  
Followers 0