Forum Discussion

cruzader's avatar
15 years ago

How to detect current OS version and OS Language (ex. if Windows XP Japanese OS)


Is there a way to detect what OS version and OS language is currently installed

in the local PC?


Ruel J. Saunar

3 Replies

  • Hello Jared,

    Thanks for the information.

    The primary task of the script I planned of creating was to determine

    if the language of the current PC's OS is English (United States).

    Below is the function I created for checking if the language is US.

    Function IsLangUS()

        sComputer = "."

        Set oWMI = GetObject("winmgmts:" _

            & "{impersonationLevel=impersonate}!\\" _

            & sComputer _

            & "\root\cimv2")


        Set colOperatingSystems = oWMI.ExecQuery _

            ("Select * from Win32_OperatingSystem")


        For Each oOS in colOperatingSystems

            iOSLang = oOS.OSLanguage



        If (iOSLang = 1033) Then

            IsLangUS = True


            IsLangUS = False

        End If

    End Function

    Is the function above correct?  Anyway, I'll also try your suggestion.



    Ruel J. Saunar
  • Hi Ruel,

    Your function seems to be correct, and you can continue using it. Checking the registry as I suggested is just one of possible solutions.