Announcement

Collapse
No announcement yet.

VB pop up windows language

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • VB pop up windows language

    is it possible for a script in VB that only pops up a message window, to detect whether Hebrew is installed on that computer, and if not to display the message in English?
    Visit iCount
    Visit MSEC
    Visit LCS-GUIDES.COM
    Visit Melariche

  • #2
    nothing?
    Visit iCount
    Visit MSEC
    Visit LCS-GUIDES.COM
    Visit Melariche

    Comment


    • #3
      First run this on a PC which you know has hebrew installed

      Code:
      strComputer = "."
      Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
      Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem")
      For Each objItem In colItems
        WScript.Echo "OS Language: " & objItem.OSLanguage
      Next
      Then create this VBS script for you actual script and change 1033 to whatever code the above script put up

      Code:
      strComputer = "."
      Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
      Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem")
      For Each objItem In colItems
      if objItem.OSLanguage <> "1033" then
        WScript.Echo "OS Language not Hebrew"
      end if
      Next
      This was taken from http://www.microsoft.com/technet/scr...s/default.mspx

      They don't usually do exactly what you want but with a little pseudo scripting knowledge you can easily make them.

      topper
      * Shamelessly mentioning "Don't forget to add reputation!"

      Comment


      • #4
        Originally posted by topper
        First run this on a PC which you know has hebrew installed

        Code:
        strComputer = "."
        Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
        Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem")
        For Each objItem In colItems
          WScript.Echo "OS Language: " & objItem.OSLanguage
        Next
        That would check if the computer is running the Hebrew version of the OS, but does not cover the case when the OS is English, but with Hebrew support (regional settings, fonts, etc...)

        One way would be to check HKEY_CURRENT_USER\Control Panel\International key and read the data of "Locale" value. For Hebrew you'd get 0000040D
        (note that this is per user setting)

        Another way would be to check whether the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Keyboard Layouts\0000040d exists
        (this is system wide setting)
        Guy Teverovsky
        "Smith & Wesson - the original point and click interface"

        Comment


        • #5
          So what would my script have to look like?

          i have the pop up script:

          *****script******

          i need to check before the script is ran if the system has hebrew support. not if it is IN hebrew... just if it can show hebrew...

          if not - i need to jump to the same script only with a pop-up in english...

          Thanks!
          Visit iCount
          Visit MSEC
          Visit LCS-GUIDES.COM
          Visit Melariche

          Comment


          • #6
            Try this:
            Code:
            Option Explicit
            
            Dim WSHShell, RegKey, HebSupport
            
            Set WSHShell = CreateObject("WScript.Shell")
            RegKey = "HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000040d\"
            
            On Error Resume Next
            HebSupport = WSHShell.RegRead (regkey & "Layout File")
            
            If Err.Number = 0 Then 
            	MsgBox("You have Hebrew support.")
            End If
            On Error Goto 0
            Guy Teverovsky
            "Smith & Wesson - the original point and click interface"

            Comment

            Working...
            X