A_OSVersion doesnt recognize windows 11 Topic is solved

Report problems with documented functionality
aaffe
Posts: 192
Joined: 16 Jan 2014, 04:23

A_OSVersion doesnt recognize windows 11

Post by aaffe » 07 Dec 2021, 07:13

windows 11 is recognized as windows 10 in A_OSVersion

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: A_OSVersion doesnt recognize windows 11

Post by swagfag » 07 Dec 2021, 22:45

howso? whats it say?

User avatar
JoeWinograd
Posts: 2198
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: A_OSVersion doesnt recognize windows 11  Topic is solved

Post by JoeWinograd » 08 Dec 2021, 00:58

aaffe wrote:windows 11 is recognized as windows 10 in A_OSVersion
See this post:
viewtopic.php?f=76&t=92403&p=409928#p409419

Note this there:
The A_OSVersion built-in var shows 10.0.22000.
Maybe you were expecting 11.x.xxxxx, but that's not what Microsoft decided to do.

To be clear, this has nothing to do with AutoHotkey, i.e., the A_OSVersion built-in variable is not "wrong". Try this...open a command prompt on W11...you'll get this (depending on your build, of course):
Microsoft Windows [Version 10.0.22000.348]
(c) Microsoft Corporation. All rights reserved.
Regards, Joe

aaffe
Posts: 192
Joined: 16 Jan 2014, 04:23

Re: A_OSVersion doesnt recognize windows 11

Post by aaffe » 08 Dec 2021, 01:33

Ok, thank you.

joefiesta
Posts: 497
Joined: 24 Jan 2016, 13:54
Location: Pa., USA

Re: A_OSVersion doesnt recognize windows 11

Post by joefiesta » 08 Dec 2021, 14:22

oh, so now microsoft is calling the old OS a brand-new Cadillac Brougham when it isn't even much different! (mind you, the "isn't much different" part is my supposition. I will try to live with win7 till I die I hated 10 so much.) I guess it's a marketing ploy to just make more money.

TheMaster11
Posts: 3
Joined: 22 Sep 2022, 13:39

Re: A_OSVersion doesnt recognize windows 11

Post by TheMaster11 » 23 Nov 2023, 11:41

This should work!

Code: Select all

; Set the registry key path
RegPath := "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3"

; Read the Settings binary value from the registry
RegRead, SettingsValue, % RegPath, Settings
;MsgBox, SettingsValue %SettingsValue%
; Extract the 9th byte from the binary value
NinthByte := SubStr(SettingsValue, 17, 1)
;MsgBox, NinthByte %NinthByte%
; Check if the 9th byte indicates auto-hide is enabled (03)
if (NinthByte = "0") {
;MsgBox, Win10
winVerson := 10
}
else if (NinthByte = "7")
{
;MsgBox, Win11
winVerson := 11
}
else
{
winVerson := A_OSVersion
}

Post Reply

Return to “Bug Reports”