Determining host operating system using VB 6
-
All of us must have come across the fact that some set of codes are specific to a particular OS only and incompatible with others. In some instances they may also lead to system crashes. In such cases we need to track and identify the OS first and then proceed accordingly. So, here is how you can write a program in VB6.0 that can run in different Windows operating systems. http://www.mindfiresolutions.com/Determining-host-operating-system-using-VB-6-189.php
Cheers, Eliza
-
All of us must have come across the fact that some set of codes are specific to a particular OS only and incompatible with others. In some instances they may also lead to system crashes. In such cases we need to track and identify the OS first and then proceed accordingly. So, here is how you can write a program in VB6.0 that can run in different Windows operating systems. http://www.mindfiresolutions.com/Determining-host-operating-system-using-VB-6-189.php
Cheers, Eliza
All very nice, but if you have to go back to the dark ages with VB6 then you should also handle windows millenium edition, windows 98, possibly windows 95 and variants of NT. If this is to be of any use going forward you also need to support Windows 7. Nowhere do you cover the server editions, which is an absolute must! Plus of course you can get all this out of the box with .Net, and seeing as vb6 is definately a legacy language now, why bother.
If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles] [My Website]
-
All of us must have come across the fact that some set of codes are specific to a particular OS only and incompatible with others. In some instances they may also lead to system crashes. In such cases we need to track and identify the OS first and then proceed accordingly. So, here is how you can write a program in VB6.0 that can run in different Windows operating systems. http://www.mindfiresolutions.com/Determining-host-operating-system-using-VB-6-189.php
Cheers, Eliza
NIce and all, but VB6 is a dead language and you're about 15 years too late to the party with this. The forums is also not the place to post such snippets. Post this in Tips/Tricks instead.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
All of us must have come across the fact that some set of codes are specific to a particular OS only and incompatible with others. In some instances they may also lead to system crashes. In such cases we need to track and identify the OS first and then proceed accordingly. So, here is how you can write a program in VB6.0 that can run in different Windows operating systems. http://www.mindfiresolutions.com/Determining-host-operating-system-using-VB-6-189.php
Cheers, Eliza
You can use "winmgmts" like this:
Private Sub Form_Load() strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & strComputer & "\root\cimv2") Set colSettings = objWMIService.ExecQuery _ ("Select * from Win32_OperatingSystem") For Each objOperatingSystem In colSettings Label1.Caption = objOperatingSystem.**Name** Next End Sub
More properties in: http://msdn.microsoft.com/en-us/library/aa394239(VS.85).aspx Hope be helpful