Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get OSVersion in Windows using C++

I have to get the OSVersion of my Windows8 System (version should be NT 6.2) to use in a C++ application. I tried using GetVersion function call. but it returned me a raw value like 602931718. Is there some way by which I can get the versions as listed here or how can I convert this raw value to a readable form?

like image 544
Jackzz Avatar asked Apr 29 '15 13:04

Jackzz


People also ask

How do I check Windows OS version?

To find out which version of Windows your device is running, press the Windows logo key + R, type winver in the Open box, and then select OK. Here's how to learn more: Select Start > Settings > System > About .

How can I tell what version of Windows is on my C drive?

How to check what Windows version you have by running the winver command. Press the Windows + R keyboard keys to launch the Run window, type winver, and press Enter. Open Terminal, Command Prompt (CMD), or PowerShell, type winver, and press Enter. You can also use the search feature to open winver.

How do I check Windows version in CMD?

Using Command Prompt or PowerShell At the Command Prompt or PowerShell, type "slmgr /dlv", and then press ENTER.

How do I identify my operating system?

Android DevicesGo to the home screen of your device. Touch "Settings," then touch "About Phone" or "About Device." From there, you can find the Android version of your device.


1 Answers

Note that functions GetVersion and GetVersionEx have been deprecated. This is also reflected in what their doc. pages say (this one copied from GetVersion):

"With the release of Windows 8.1, the behavior of the GetVersion API has changed in the value it will return for the operating system version. The value returned by the GetVersion function now depends on how the application is manifested."

like image 143
Vesa P. Avatar answered Oct 06 '22 00:10

Vesa P.