Rahul
Rahul

Reputation: 471

Last Build number in OSVERSIONINFOEX

I wanted to get the os product version as 6.3.9600.17415 when using OSVERSIONINFOEX i successfully get 6.3.9600

how to get the last build number that is 17415

Upvotes: 0

Views: 626

Answers (1)

Brandon Staggs
Brandon Staggs

Reputation: 630

If you really need the exact build number, use GetFileVersionInfo on kernel32.dll. This post explains using GetFileVersionInfo:

https://stackoverflow.com/a/17286050/2501336

This is a documented means of getting the true OS build number and is immune from virtualization:

Getting the System Version

To obtain the full version number for the operating system, call the GetFileVersionInfo function on one of the system DLLs, such as Kernel32.dll, then call VerQueryValue to obtain the \\StringFileInfo\\<lang><codepage>\\ProductVersion subblock of the file version information.

Upvotes: 3

Related Questions