Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to get Windows version

Dec
47
2
The internal variable %_winver used by Take Command / TCC is useless because it returns 10.0 on both Windows 10 and Windows 11.

This is Microsoft's fault, but the question remains: how do I determine what version of Windows is actually running from a TCC batch file?
 
Code:
E:\Utils>echo %@verinfo[c:\windows\explorer.exe,ProductVersion]
10.0.19041.3324

Code:
wmic os get caption, buildnumber, version, csdversion, OSArchitecture
BuildNumber  Caption                   CSDVersion  OSArchitecture  Version
19044        Microsoft Windows 10 Pro              64-bit          10.0.19044

Code:
E:\Utils>wmic os get version
Version
10.0.19044

Added:
Code:
E:\Utils>echo %_winver.%_osbuild
10.0.19044

Code:
E:\Utils>echo %_winver.%_osbuildex
10.0.19044.3086

? 3324 <> 3086

I'm gonna go with 10.0.19044.3086

Joe
 
I do this.

Code:
set ubr=%@regquery["HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\UBR"]
set releaseid=%@regquery["HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ReleaseId"]
set displayversion=%@regquery["HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DisplayVersion"]
set winver=%@wmi[.,"Select Version from Win32_OperatingSystem"]

echo %winver.%ubr (%releaseid, %displayversion)

And I get this.

Code:
10.0.19045.3448 (2009, 22H2)
 
Code:
[C:\HoldThis\BTM_001]GetVersion.btm
10.0.19045.3448 (2009, 22H2)
 
After performing a Microsoft Update;
Code:
E:\Utils>echo %_winver.%_osbuildex (%@regquery["HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DisplayVersion"]) 
10.0.19045.3448 (22H2)

Joe
 
The internal variable %_winver used by Take Command / TCC is useless because it returns 10.0 on both Windows 10 and Windows 11.

This is Microsoft's fault, but the question remains: how do I determine what version of Windows is actually running from a TCC batch file?

The internal VER command looks at the build number - if it's >= 22000, then it's Windows 11.
 

Similar threads

Back
Top