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. C#
  4. How to get OS name?

How to get OS name?

Scheduled Pinned Locked Moved C#
questiontutorial
5 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.
  • S Offline
    S Offline
    S a n d y
    wrote on last edited by
    #1

    Hello, How to get the different OS names which are used in users system. Like OS is XP or Vista. How can I get users operating system is XP or Vista when I am using windows programming? Reply..

    N B A 3 Replies Last reply
    0
    • S S a n d y

      Hello, How to get the different OS names which are used in users system. Like OS is XP or Vista. How can I get users operating system is XP or Vista when I am using windows programming? Reply..

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Use WMI to get the details. Read about ManagementObjectSearcher class.

      Navaneeth How to use google | Ask smart questions

      1 Reply Last reply
      0
      • S S a n d y

        Hello, How to get the different OS names which are used in users system. Like OS is XP or Vista. How can I get users operating system is XP or Vista when I am using windows programming? Reply..

        B Offline
        B Offline
        bcozican
        wrote on last edited by
        #3

        Try System.Environment.OSVersion

        1 Reply Last reply
        0
        • S S a n d y

          Hello, How to get the different OS names which are used in users system. Like OS is XP or Vista. How can I get users operating system is XP or Vista when I am using windows programming? Reply..

          A Offline
          A Offline
          Abhijit Jana
          wrote on last edited by
          #4

          Add System.Management.dll as Reference using System.Management; ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_SystemOperatingSystem"); foreach (ManagementObject queryObj in searcher.Get()) { Console.WriteLine("PartComponent: {0}", queryObj["PartComponent"]); }

          cheers, Abhijit

          S 1 Reply Last reply
          0
          • A Abhijit Jana

            Add System.Management.dll as Reference using System.Management; ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_SystemOperatingSystem"); foreach (ManagementObject queryObj in searcher.Get()) { Console.WriteLine("PartComponent: {0}", queryObj["PartComponent"]); }

            cheers, Abhijit

            S Offline
            S Offline
            S a n d y
            wrote on last edited by
            #5

            Thanks

            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