![Confused :?](./images/smilies/icon_e_confused.gif)
I have a AHK script that won't work if you're not running Windows 11, so I need it to check.
Code: Select all
MsgBox % A_OSVersion
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
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
*/
;==================================================