@just me danke für die Infos
anbei ein Skript Beispiel
Productname = Windows 10 Pro , wobei Build>Name ist = 22000 -> "Win 11 21H2" ( ich habe Windows-11)
;-
viewtopic.php?f=6&t=3514 ;- parts from user
@jNizM
A collection of small ahk functions - AutoHotkey Community
;-
Code: Select all
/*
Die interne Variable liefert für Windows 10 und 11 eine Zeichenfolge im Format "Haupt.Neben.Build" (englisch "major.minor.build").
Dabei steht in "Haupt.Neben" für alle bisherigen Versionen immer 10.0.
Beispiel:
-----------------------------
Full-version = 10.0.22000.493 ;-- Major.Minor.BuildNumber.UBR < UBR=Update-Build-Revision ( see also cmd =ver )
Build-Name/Number = 21H2/22000
OSinstallDate = 08. März 2022 - 20:38 | (639 days)
ProductID = 00330-51660-51169-AAOEM
Productname = Windows 10 Pro
Computername = DESKTOP-QJ0O5KT
releaseID = 2009
is64bit = 1
Processorname = Intel(R) Pentium(R) Silver J5005 CPU @ 1.50GHz
AHK-VERSION = 1.1.37.01
SCREEN = 3840*2160
Username=Admin = ursul=0
Memory = 8032.41
-----------------------
*/
;----------------------
;----------------------
e1=
(
-----------------------
Build -> "Name"
-----------------------
10240 -> "Win 10 1507"
10586 -> "Win 10 1511"
14393 -> "Win 10 1607"
15063 -> "Win 10 1703"
16299 -> "Win 10 1709"
17134 -> "Win 10 1803"
17763 -> "Win 10 1809"
18362 -> "Win 10 1903"
18363 -> "Win 10 1909"
19041 -> "Win 10 2004"
19042 -> "Win 10 20H2"
19043 -> "Win 10 21H1"
19044 -> "Win 10 21H2"
19045 -> "Win 10 22H2"
22000 -> "Win 11 21H2"
22621 -> "Win 11 22H2"
22631 -> "Win 11 23H2"
-----------------------
)
;------------------------------------
F1=%a_scriptdir%\Windows_Version.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
RegRead,UBR, %Path%,UBR
RegRead, ProcessorName, HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0, ProcessorNameString
osinstalldate1:=OSInstallDate()
GMSEx := GlobalMemoryStatusEx()
GMSExM01 := Round(GMSEx[2] / 1024**2, 2)
;---------
FileAppend,
(
DateNow = %suomi%`r`n-----------------------------
Full-version = %A_OSVersion%.%ubr% ;-- Major.Minor.BuildNumber.UBR < UBR=Update-Build-Revision ( see also cmd =ver )
Build-Name/Number = %version%/%BuildNumber%
OSinstallDate = %osinstalldate1%
ProductID = %productID%
Productname = %ProductName%
Computername = %A_ComputerName%
releaseID = %ReleaseID%
is64bit = %A_Is64bitOS%
Processorname = %processorname%
AHK-VERSION = %a_ahkversion%
SCREEN = %A_screenwidth%*%A_screenHeight%
Username=Admin = %a_username%=%a_isadmin%
Memory = %GMSExM01%
%e1%
),%f1%,utf-8
try
run,%f1%
exitapp
;--------------
;-- https://www.autohotkey.com/boards/viewtopic.php?f=6&t=3514 jNizM
;-- A collection of small ahk functions - AutoHotkey Community
;-- https://www.autohotkey.com/boards/viewtopic.php?p=49269#p49269
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)"
}
}
GlobalMemoryStatusEx() {
static MEMORYSTATUSEX, init := VarSetCapacity(MEMORYSTATUSEX, 64, 0) && NumPut(64, MEMORYSTATUSEX, "UInt")
if (DllCall("Kernel32.dll\GlobalMemoryStatusEx", "Ptr", &MEMORYSTATUSEX))
{
return { 2 : NumGet(MEMORYSTATUSEX, 8, "UInt64")
, 3 : NumGet(MEMORYSTATUSEX, 16, "UInt64")
, 4 : NumGet(MEMORYSTATUSEX, 24, "UInt64")
, 5 : NumGet(MEMORYSTATUSEX, 32, "UInt64") }
}
}
;================================================
Code: Select all
-----------------------------
Full-version = 10.0.22000.493 ;-- Major.Minor.BuildNumber.UBR < UBR=Update-Build-Revision ( see also cmd =ver )
Build-Name/Number = 21H2/22000
OSinstallDate = 08. März 2022 - 20:38 | (639 days)
ProductID = 00330-51660-51169-AAOEM
Productname = Windows 10 Pro
Computername = DESKTOP-QJ0O5KT
releaseID = 2009
is64bit = 1
Processorname = Intel(R) Pentium(R) Silver J5005 CPU @ 1.50GHz
AHK-VERSION = 1.1.37.01
SCREEN = 3840*2160
Username=Admin = ursul=0
Memory = 8032.41
-----------------------