WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

How To
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Get Preferred Language


Question:

Can any body tell me, how can i get the current user Windows language configuration, i need to know the preferred language for the current user.

Answer:


objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
colOperatingSystems = objWMI.ExecQuery ("Select * from Win32_OperatingSystem")
ForEach objOS In colOperatingSystems
   OSLang = objOS.OSLanguage
Next
Message("Decimal OS language number: " , OSLang)
colOperatingSystems = 0
objWMI = 0
Exit
The script above will return 1033 (hex 0409) for an English OS.

You can map the hex value to the country using the list under this registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MIME\Database\Rfc1766 

Article ID:   W17002
File Created: 2007:07:03:14:27:32
Last Updated: 2007:07:03:14:27:32