[WindowsVer] and new versions of windows - Forum

Forum Navigation
You need to log in to create posts and topics.

[WindowsVer] and new versions of windows

Hi overthere,

I need determine the version of windows.

I used the [WindowsVer] enviroment variable and returned  "6.2" for Win10

Could any create a table with another versions of windows?

Thanks in advance,

David de Argentina

@daviddeargentina

 

https://docs.microsoft.com/en-us/windows/win32/sysinfo/operating-system-version

 

Hello,

This is another sample where MS breaks/change WIN Api.

Here was used "win32majorversion" which seems no longer supported by MS.

When you are familar with system DLL calls you can take a look at

RtlGetVersion from ntdll.dll

https://stackoverflow.com/questions/58466440/get-win32majorversion-and-win32minorversion-correctly-in-windows-8-1-10Delphi sample from here: 
procedure TForm1.Button1Click(Sender: TObject);
type
  _OSVERSIONINFOEXW = record
    dwOSVersionInfoSize: DWORD;
    dwMajorVersion: DWORD;
    dwMinorVersion: DWORD;
    dwBuildNumber: DWORD;
    dwPlatformId: DWORD;
    szCSDVersion: array [0..127] of WCHAR;
    wServicePackMajor: WORD;
    wServicePackMinor: WORD;
    wSuiteMask: WORD;
    wProductType: BYTE;
    wReserved: BYTE;
  end;
  RTL_OSVERSIONINFOEXW = _OSVERSIONINFOEXW;
  pfnRtlGetVersion = function(var RTL_OSVERSIONINFOEXW): LongInt; stdcall;
var
  OS: RTL_OSVERSIONINFOEXW;
  RtlGetVersion: pfnRtlGetVersion;
begin
  @RtlGetVersion := GetProcAddress(GetModuleHandle('ntdll.dll'), 'RtlGetVersion');
  if Assigned(RtlGetVersion) then
  begin
    ZeroMemory(@OS, SizeOf(OS));
    OS.dwOSVersionInfoSize := SizeOf(OS);
    if (RtlGetVersion(OS) = 0) then
    begin
      Memo1.Lines.Add('MajorVersion: ' + IntToStr(OS.dwMajorVersion));
      Memo1.Lines.Add('MinorVersion: ' + IntToStr(OS.dwMinorVersion));
      Memo1.Lines.Add('BuildNumber: ' + IntToStr(OS.dwBuildNumber));
      Memo1.Lines.Add('ServicePackMajor: ' + IntToStr(OS.wServicePackMajor));
      Memo1.Lines.Add('ServicePackMinor: ' + IntToStr(OS.wServicePackMinor));
      Memo1.Lines.Add(OS.szCSDVersion);
    end;
  end;
end;

Regards
Hans-Peter

 

emo has reacted to this post.
emo

Here the output  of the delphi sample of 2 PC:

WIN 10

MajorVersion: 10
MinorVersion: 0
BuildNumber: 19042
ServicePackMajor: 0
ServicePackMinor: 0

WIN7

MajorVersion: 6
MinorVersion: 1
BuildNumber: 7601
ServicePackMajor: 1
ServicePackMinor: 0
Service Pack 1

 

You may read also the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion

 

CN_Iceman has reacted to this post.
CN_Iceman

For WIN 10:

https://en.wikipedia.org/wiki/Windows_10_version_history

 

A gift ;-)

 

Uploaded files:
  • You need to login to have access to uploads.
Vadim, farhad2008 and CN_Iceman have reacted to this post.
Vadimfarhad2008CN_Iceman

Hello Emmanuel,

Thanks for the quick gift, but I think a complete plugin is a bit overhead for such a basic info. ;-)

I think the WindowsBuildNumber is the most interested info.

So the next VisualNeoWin-update will have a new global variable [WindowsVerBuild].

We have [WindowsVerName] yet.

Regards

Hans-Peter

 

 

 

 

Vadim and emo have reacted to this post.
Vadimemo

;-)
In my case [WindowsVerName] from VisualNeoWin tells me that my operating system is Windows 10 Enterprise, but the Windows system information shows Windows 10 Pro.

https://www.microsoft.com/en-us/WindowsForBusiness/Compare

https://i.ibb.co/jkyyydN/windowssysteminfo.jpg
https://i.ibb.co/2NWtmkM/visualneoname-and-Rtl-Get-Version.jpg

 

 

Hello,

Whatever MS does, take a look with regedit at:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\Produktname

When it is wrong there, then MS did it.

Regardy

Hans-Peter

 

When you want to know which build number is which winver:

https://www.gaijin.at/en/infos/windows-version-numbers

Hi Hans,
I thought you were going to do it with the wProductType and from there get the version determined by the VER_NT_WORKSTATION conditions.
https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/ns-wdm-_osversioninfoexw
This is what I have tried to do, but I cannot test it because I only have machines with windows 10.

The way you say is to see the build and get what version you have, that's fine! If it does not work how I have tried to do it I do it like this.

Uploaded files:
  • You need to login to have access to uploads.
CN_Iceman has reacted to this post.
CN_Iceman

[WindowsVerBuild] now here:

 

Vadim, CN_Iceman and rcohen have reacted to this post.
VadimCN_Icemanrcohen

Thanks all!