Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Detecting MUI OSLanguage

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,40687
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Detecting MUI OSLanguage
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Detecting MUI OSLanguage - 12/10/2006 11:50:05 AM   
  snap_fl

 

Posts: 2
Score: 0
Joined: 12/10/2006
Status: offline
Hi,

I am trying to write a vbscript to detect the OSLanguage ID that the current system is set to, but currently when I do:


      

I am always getting 1033 (English), which was the base OS. I am using an MUI image across several servers and some of them use (French, German, Spanish & Japanese) by setting the "Languages" tab from the "Regional and Language Options" in the control panel.

I figured once the MUI OS is set to another language, the OSLanguage that I query will return the associated ID instead of 1033 (English).

Do any of you know of some other property I can query? Thanks in advance.
 
 
Post #: 1
 
 RE: Detecting MUI OSLanguage - 12/11/2006 3:15:33 PM   
  kirrilian


Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
try this:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For Each objOS in colOSes
WScript.Echo "OS Language: " & objOS.OSlanguage
   for each lang in objOS.MUILanguages
       wscript.echo lang
   next
Next

I dont have any language packs installed so it errors out on my machine (at least I assume thats why)

_____________________________

Have you searched here ?
VBScript Fundamentals
My Site

(in reply to snap_fl)
 
 
Post #: 2
 
 RE: Detecting MUI OSLanguage - 12/12/2006 10:33:46 AM   
  snap_fl

 

Posts: 2
Score: 0
Joined: 12/10/2006
Status: offline
I tried the script, but it errors out after the first wscript.echo for the OSLanguage.

I don't think this piece works:
  for each lang in objOS.MUILanguages
      wscript.echo lang
  next

Also, my goal is to determine the 1 language that the current system is set to, the server image could have MUI packs for multiplelanguages installed.

Any other ideas? Thanks!

(in reply to kirrilian)
 
 
Post #: 3
 
 RE: Detecting MUI OSLanguage - 12/12/2006 1:42:21 PM   
  ebgreen


Posts: 5246
Score: 31
Joined: 7/12/2005
Status: offline
What is the error?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to snap_fl)
 
 
Post #: 4
 
 RE: Detecting MUI OSLanguage - 12/13/2006 1:09:52 AM   
  kirrilian


Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
quote:

ORIGINAL: snap_fl

I tried the script, but it errors out after the first wscript.echo for the OSLanguage.

I don't think this piece works:
for each lang in objOS.MUILanguages
    wscript.echo lang
next

Also, my goal is to determine the 1 language that the current system is set to, the server image could have MUI packs for multiplelanguages installed.

Any other ideas? Thanks!


Sorry, my misunderstanding. I would assume that what you already had would work then.

_____________________________

Have you searched here ?
VBScript Fundamentals
My Site

(in reply to snap_fl)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Detecting MUI OSLanguage Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts