Brenton Posted April 16, 2009 Share Posted April 16, 2009 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 More sharing options...
Mat Posted April 16, 2009 Share Posted April 16, 2009 You don't have permission becouse you don't have 5 posts, get a mod to move it... that looks quite handy, Not that i'd have any use for it, winxp all the way! AutoIt Project Listing Link to comment Share on other sites More sharing options...
KaFu Posted April 16, 2009 Share Posted April 16, 2009 Looking at Version-Info of my XP (5.1.26...) this might be more accurate in the long run ... StringLeft($version,2) = "6." OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Brenton Posted April 16, 2009 Author Share Posted April 16, 2009 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 More sharing options...
dot45 Posted June 10, 2009 Share Posted June 10, 2009 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. Tools I've Created & Shared[/url][url="http://www.autoitscript.com/forum/index.php?showtopic=97177&st=0&p=698665&hl=printer&fromsearch=1&#entry698665"]Printer Migration Tool Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now