Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VB6 code to find windows OS version

Tags:

windows

vb6

I am using OSVERSIONINFO to check the OS in my vb6 application. But i am not able differentiate between windows 7 and windows server 2008 R2 because they have same version number,dwMajorVersion and dwMinorVersion. So how to differentiate between these. I think it can be done in vb.net using some other method. But how it can be done in vb6?

like image 713
IT researcher Avatar asked Jan 24 '26 21:01

IT researcher


1 Answers

As Xearinox noted in the above comment, OSVERSIONINFOEX returns more information.

In particular, you can examine wProductType to determine whether VER_NT_WORKSTATION (0x0000001) is set or not. If it is, the machine is running a client OS, otherwise, server.

The chart in the remarks section of the OSVERSIONINFO MSDN entry even has a column which points out detecting the various OS's using that struct item.

like image 77
Lynn Crumbling Avatar answered Jan 27 '26 13:01

Lynn Crumbling



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!