Quantcast
Channel: AutoHotkey Community
Viewing all articles
Browse latest Browse all 579

Tutorials (v2) • Re: A_OSVersion for Win10/11

$
0
0

For anyone who stumbles across this post, here is a simple function to determine if you're running Windows 10 or Windows 11.

CODE:

GetWinOSVersion()
{
i := A_OSVersion

If (i < 10.0.20000) ; You're running Windows 10
Return 10
Else If (i >= 10.0.20000) ; You're running Windows 11
Return 11
}



I think you would have to use VerCompare for this type of comparison.

What you just tried would break because those are not actual numbers due to the second . in the versioning system.

Statistics: Posted by RaptorX — Today, 16:17



Viewing all articles
Browse latest Browse all 579

Trending Articles