How to change System Locale in Windows 2003 using command line

7,708

Solution 1

I don't know of a command line utility that strictly does this, but you could use a small bit of VBScript to change the associated registry values. It's not as straightforward as changing the locale in the General tab of the Regional and Language Options dialog, but it works.

For example, to change the settings to match "English (United Kingdom)" you can use something like this:

Dim WSHShell
Set WSHShell = CreateObject("Wscript.Shell")

WSHShell.RegWrite "HKCU\Control Panel\International\iCountry", "44", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iCurrDigits", "2", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iCurrency", "0", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iDate", "1", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iDigits", "2", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iLZero", "1", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iMeasure", "0", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iNegCurr", "1", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iTime", "1", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iTLZero", "1", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\Locale", "00000809", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\s1159", "AM", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\s2359", "PM", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sCountry", "United Kingdom", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sCurrency", "£", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sDate", "/", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sDecimal", ".", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sLanguage", "ENG", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sList", ",", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sLongDate", "dd MMMM yyyy", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sShortDate", "dd/MM/yyyy", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sThousand", ",", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sTime", ":", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\DefaultBlindDialFlag", "00", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sTimeFormat", "HH:mm:ss", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iTimePrefix", "0", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sMonDecimalSep", ".", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sMonThousandSep", ",", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iNegNumber", "1", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sNativeDigits", "0123456789", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\NumShape", "1", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iCalendarType", "1", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iFirstDayOfWeek", "0", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iFirstWeekOfYear", "0", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sGrouping", "3;0", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sMonGrouping", "3;0", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sPositiveSign", "", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sNegativeSign", "-", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\Geo\Nation", "244", "REG_SZ"

Solution 2

There is no Win32 API or Scripting (WMI) to switch system locale. However, you can use this command line to do it:

rundll32 shell32, Control_RunDLL intl.cpl,,/f:”c:\locale.txt”

The content of C:\locale.txt looks like:

[RegionalSettings]

LanguageGroup=13

SystemLocale=0401

UserLocale=0401

InputLocale=0409:00000409,0401:00000401

(This will change System and User locale to Arabic – Saudi Arabia and add Arabic keyboard).


Taken from Microsoft KB

Share:
7,708

Related videos on Youtube

Jeff Atwood
Author by

Jeff Atwood

Stack Overflow Valued Associate #00001 Wondering how our software development process works? Take a look! Find me on twitter, or read my blog. Don't say I didn't warn you because I totally did. However, I no longer work at Stack Exchange, Inc. I'll miss you all. Well, some of you, anyway. :)

Updated on September 25, 2020

Comments

  • Jeff Atwood
    Jeff Atwood over 1 year

    Is there any command line utility to change the system locale in Windows 2003?

  • David Crow
    David Crow almost 14 years
    Note that the user may have to log off/on again for the change to take effect.