Windows version

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Ben the Coder

Windows version

01 Aug 2022, 16:18

Is there any way to use a command to get the user's version of Windows? :?
I have a AHK script that won't work if you're not running Windows 11, so I need it to check.
User avatar
Spawnova
Posts: 557
Joined: 08 Jul 2015, 00:12
Contact:

Re: Windows version

01 Aug 2022, 16:23

Seems like you may be interested in A_OSVersion

Code: Select all

f1::
msgbox % a_osversion
exitapp
Ben the Coder

Re: Windows version

01 Aug 2022, 16:38

Unfortunately, the program does not work!
It just pops up a MsgBox saying that I'm running 10.0.22000 when I'm clearly running Windows 11!
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Windows version

01 Aug 2022, 16:43

You forgot that this is Microsoft. :) 10.0.22000 and up means Win11. https://www.lifewire.com/windows-version-numbers-2625171 :crazy:
Ben the Coder

Re: Windows version

01 Aug 2022, 20:02

I read the document, and yes, that's weird! Thanks for teaching me!
User avatar
hced
Posts: 9
Joined: 11 Nov 2019, 13:30

Re: Windows version

23 Sep 2023, 09:06

Does anyone know a method to output this information (per winver) ?
Snipaste_20230923160256.png
Snipaste_20230923160256.png (52.26 KiB) Viewed 758 times

[Mod edit: Removed duplicate image (original had link to online image as well as attached image).]
garry
Posts: 3795
Joined: 22 Dec 2013, 12:50

Re: Windows version

23 Sep 2023, 14:14

Release Date: 9/12/2023
Version : OS Build 22621.2283
What is Windows 11 version 10.0 22621?
The Windows 11 2022 Update (also known as version 22H2 and codenamed "Sun Valley 2") is the first and current major update to Windows 11. It carries the build number 10.0.22621.

Code: Select all

runwait,%comspec% /U /c systeminfo | clip,,hide      ;- systeminfo to clipboard
msgbox,%clipboard%
return

some infos from script below :

Code: Select all

osversion    = 10.0.22000
VERSION      = 21H2
BuildNumber  = 22000
OSinstallDate= 08. März 2022 - 20:38   |   (564 days)
ProductID    = 00330-51660-51169-AAOEM
Productname  = Windows 10 Pro
Computername = DESKTOP-QJ0O5KT
releaseID    = 2009
is64bit      = 1

Code: Select all

F1=%a_scriptdir%\OS information_log.txt
ifexist,%f1%
 filedelete,%f1%
FormatTime, Suomi , L1035, dddd MMMM yyyy-MM-dd  HH:mm
Path = HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegRead, ProductID, %Path%, ProductID
RegRead, ProductName, %Path%, ProductName
RegRead, ReleaseID, %Path%, ReleaseID
RegRead, version, %Path%,DisplayVersion
RegRead, buildnumber, %Path%,currentbuild
osinstalldate1:=OSInstallDate()
FileAppend,
(
DateNow      = %suomi%`r`n-----------------------------
osversion    = %A_OSVersion%
VERSION      = %version%
BuildNumber  = %BuildNumber%
OSinstallDate= %osinstalldate1%
ProductID    = %productID%
Productname  = %ProductName%
Computername = %A_ComputerName%
releaseID    = %ReleaseID%
is64bit      = %A_Is64bitOS%
),%f1%,utf-8
try
 run,%f1%
return

OSInstallDate()
{
    for objItem in ComObjGet("winmgmts:").ExecQuery("SELECT * FROM Win32_OperatingSystem")
    {
        FormatTime, InstOS, % SubStr(objItem.InstallDate, 1, 14), % "dd. MMM yyyy - HH:mm"
        FormatTime, DateFrom, % SubStr(objItem.InstallDate, 1, 14), % "yyyyMMdd"
        DateTo := A_Now
        DateTo -= DateFrom, days
        return InstOS "   |   (" DateTo " days)"
    }
}

/*
DateNow      = lauantai syyskuu 2023-09-23  21:10
-----------------------------
osversion    = 10.0.22000
VERSION      = 21H2
BuildNumber  = 22000
OSinstallDate= 08. März 2022 - 20:38   |   (564 days)
ProductID    = 00330-51660-51169-AAOEM
Productname  = Windows 10 Pro
Computername = DESKTOP-QJ0O5KT
releaseID    = 2009
is64bit      = 1
*/
;==================================================

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], macromint, Spawnova and 352 guests