Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Determining host operating system using VB 6

Determining host operating system using VB 6

Scheduled Pinned Locked Moved Visual Basic
phpcom
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    elizas
    wrote on last edited by
    #1

    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

    T D J 3 Replies Last reply
    0
    • E elizas

      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

      T Offline
      T Offline
      The Man from U N C L E
      wrote on last edited by
      #2

      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]

      1 Reply Last reply
      0
      • E elizas

        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

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        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...

        1 Reply Last reply
        0
        • E elizas

          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

          J Offline
          J Offline
          Joao_Machado
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups