Can systeminfo (of command prompt > systeminfo) provide me with the major build number of w10? I want to check if something is in 19045.x.
I know about winver, but I am looking for something whose output can be echoed* in a text file. If the above is not doable, is there a database or page or something that lists ALL version of windows 10/10 with their build number? E.g. 22h2 is 19045.x, 21h2 is 19044.x and so on. *"Echoed" is not the right word probably, but I am talking about the equivalent of the (function?) ">" executes, but in windows Code: dmesg | grep aword > afile.txt The above runs dmesg (built in shell command), searches the entire output for "aword" and outputs all the lines containing it to "afile.txt".
Try these powershell commands : Code: $Version = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\" "Microsoft Windows version $($Version.DisplayVersion) (Operating system build $($Version.CurrentBuildNumber).$($Version.UBR))" ` |Out-File "path to your file" File content example : Microsoft Windows version 23H2 (Operating system build 22631.2792)
I think that what GezoeSloog suggested above is the simplest way one can do it. Not that the long powershell is bad, it is just that an average user will run it and writing all that is impossible. A few months ago she was asked to write "choco install something --reinstall" in powershell and I had to guide her step by step. Also, thank you for mentioning "get-itemproperty". I assume it is the similar to the source command in linux, e.g. Code: $ echo $VERSION_CODENAME (returns nothing) $ source /etc/os-release $ echo $VERSION_CODENAME trixie
I agree, the long powershell statement is ugly and unpractical, but it can be split. The execution of a cmd script with the following statements : Code: @set "s=$V=gp 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion';" @set "s=%s%\"Microsoft $($V.ProductName) version" @set "s=%s% $($V.DisplayVersion) (Operating system build" @set "s=%s% $($V.CurrentBuildNumber).$($V.UBR))\"" @powershell %s%&pause displays (on my pc) : Microsoft Windows 10 Enterprise version 23H2 (Operating system build 22631.2861)
CMD batch to export Window version from registry to a text file: (Build number, Edition and Codename) Code: @echo off cmd /c ver > c:\Version.txt reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v "ProductName" >> c:\Version.txt reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v "DisplayVersion" >> c:\Version.txt Query will be output to a text file named "Version.txt" in C:\ Modify both according to your needs. Output example: Code: Microsoft Windows [Version 10.0.19045.3693] HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion ProductName REG_SZ Windows 10 Pro HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion DisplayVersion REG_SZ 22h2
Code: @echo off set "key=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" for /F "skip=2 tokens=1,2*" %%I in ('reg query "%key%" /v ProductName') do set "PN=%%K" for /F "skip=2 tokens=1,2*" %%I in ('reg query "%key%" /v DisplayVersion') do set "DV=%%K" for /F "skip=2 tokens=1,2*" %%I in ('reg query "%key%" /v CurrentBuildNumber') do set "CBN=%%K" for /F "skip=2 tokens=1,2*" %%I in ('reg query "%key%" /v UBR') do set /A "UBR=%%K" echo Microsoft %PN% version %DV% (Operating system build %CBN%.%UBR%) pause
For Windows 10 & 11 : Code: @echo off set "key=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" for /f "tokens=6 delims=[]. " %%I in ('ver') do set build=%%I IF %build% GEQ 19041 SET "Win=10" IF %build% GEQ 21996 SET "Win=11" for /F "skip=2 tokens=1,2*" %%I in ('reg query "%key%" /v EditionID') do set "Edition=%%K" for /F "skip=2 tokens=1,2*" %%I in ('reg query "%key%" /v DisplayVersion') do set "DV=%%K" for /f "tokens=4 delims=] " %%i in ('ver') do set "build=%%i" echo Microsoft Windows %Win% %Edition% version %DV% (Operating system build %build%) pause
FYI: "displayversion" value is nonexistant for older Win 10 versions such as LTSB 1607 and LTSC 1809 before 2xHx started being used by Msoft. Code: ERROR: The system was unable to find the specified registry key or value. Microsoft Windows EnterpriseS version (Operating system build 10.0.17763.5206)
Y're right. The script is ok starting with build 19041. You could try this (not sure if your powershell version returns needed infos) : Code: @echo off set "s=$ubr=(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ubr;" set "s=%s%$info=Get-ComputerInfo;" set "s=%s%\"$($info.OSName) " set "s=%s%version $($info.OSDisplayVersion) " set "s=%s%(Operating system build $($Info.OsVersion).$ubr)\"" powershell "$progressPreference='silentlyContinue';%s%" pause
was actually looking for a way to add the value from HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').DisplayVersion to the desktop along with version and build that is enabled by the "HKCU\Control Panel\Desktop" /V PaintDesktopVersion tweak.
Seriously. Your link IS the paintdesktop tweak. Everyone knows about the paintdesktop tweak. The problem is that the tweak does not enable display of HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').DisplayVersion (ie 22H2, 23H2,24H2 etc) It only show Os Version (Windows 11) and Build #.
Neither the PaintDesktopVersion (HKCU\ControlPanelDesktop) nor DisplayVersion (HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows) keys can display that value. They are hardcoded and only show the true base build number. DisplayVersion (HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion) is only in Registry and can be easily faked, possibly that's why they didn't include it. Either that or they actually never updated that ancient feature at all, like a lot of old things in Windows. You might be able to use a tool like DesktopInfo.
This is not possible with a simple registry tweak. The trick is mostly seen in WinPE's as in live OS it's involving patched critical Windows system initialization files. Since you only need to show the "DisplayVersion" (22H2/23H2/24H2), easy workaround is to modify the "BuildLab" key value to whatever you like:
i considered modifying the registry to insert the display version data, but worry it might affect something that actually needs that data to not be modified, perhaps Update Target version. Might as well modify ProductName. But modifying ProductName doesn't work.