Click here to Skip to main content
13,559,019 members
Click here to Skip to main content
Add your own
alternative version


27 bookmarked
Posted 22 Jun 2005

Operating System Information

Rate this:
Please Sign up or sign in to vote.
An article on finding the OS name and OS language.

Sample Image


This code finds OS information, i.e., it finds the name of the OS which is installed in your machine and the language of the OS.

Using the code

This code uses the WqlObjectQuery to find OS information. It uses the namespace System.Management. What is does is it basically finds the locale of the OS which is specific for a particular language of the OS. It actually queries the table win32_OperatingSystem which comes up with the operating system to find the OS name and the locale of the OS. This code runs on both 32 bit and 64 bit OS if there is .NET framework installed in the OS. For example, I make the code to find the locale of 8 different languages like English, German, French, Russian, Spanish, PortBraz, Polish and Italian. Any locale can be added to the code to find the OS Language.

Dim objectQuery As New WqlObjectQuery("select * from win32_OperatingSystem")
Dim searcher As New ManagementObjectSearcher(objectQuery)
Dim share As ManagementObject
Dim a As String
Dim os As String
For Each share In searcher.Get()
    a = share("Name")
    Dim split1 As String()
    split1 = Split(a, "|")
    os = split1(0)
    TextBox2.Text = os
    Button2.Text = os
Next share

For Each share In searcher.Get()

    a = share("Locale")
    If a = "0409" Then
        TextBox1.Text = "English"
        Button1.Text = "English"
    ElseIf a = "0407" Then
        TextBox1.Text = "German"
        Button1.Text = "German"
    ElseIf a = "040a" Then
        TextBox1.Text = "Spanish"
        Button1.Text = "Spanish"
    ElseIf a = "040c" Then

Points of Interest

This code is useful for GUI translation. Using this code one can translate the GUI to any specific language.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author
Web Developer
United States United States
I am a Computer Engineer and in the Software
Industry for 1 year.Working on VC++,and Client Server architecture.

You may also be interested in...


Comments and Discussions

Generalpushpa Pin
pushpaabhi11-Jun-08 22:25
memberpushpaabhi11-Jun-08 22:25 
QuestionDetect Licence Language version of OS? Pin
boshesh13-Jul-06 5:15
memberboshesh13-Jul-06 5:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.180515.1 | Last Updated 23 Jun 2005
Article Copyright 2005 by
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid