How to change keyboard and region settings from command line .

If installed system has not national settings like time zone, keyboard type or currency configured by default during system installation, it must be done before user start complain on it . So it can be done via windows gui, and command line which is easier to repeat on each PC via GP or batch file.

Settings can be set by executing command line :

control.exe intl.cpl,,/f:”P:\IT\lang\localepl.xml”

where „P:\IT\lang\localepl.xml” is localization of the file which contains  code :

<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">
<gs:UserList>
<gs:User UserID="Current" CopySettingsToDefaultUserAcct="true" CopySettingsToSystemAcct="true"/>
</gs:UserList>
<!--Location Preferences-->
<gs:LocationPreferences>
<gs:GeoID Value="191"/>
</gs:LocationPreferences>
<gs:InputPreferences>
<!--pl-PL--><gs:InputLanguageID Action="add" ID="0415:00000415" Default="true"/>
<!--pl-PL--><gs:InputLanguageID Action="add" ID="0415:00000415"/>
</gs:InputPreferences>
<!-- user locale -->
 <gs:UserLocale>
  <gs:Locale Name="pl-PL" SetAsCurrent="true" ResetAllSettings="true"/>
 </gs:UserLocale>
<!-- system locale -->
<gs:SystemLocale Name="pl-PL" />
</gs:GlobalizationServices>

full description at:

https://support.microsoft.com/pl-pl/help/2764405/how-to-automate-regional-and-language-settings-in-windows-vista,-windows-server-2008,-windows-7-and-in-windows-server-2008-r2

and

https://msdn.microsoft.com/en-us/goglobal/bb964650

Shortly:

I used there

<gs:GeoID Value="191"/>

Which belongs to PL  full list of codes fo other countries can be found at:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd374073%28v=vs.85%29.aspx

It will set timezone and currency for your country.

<!--pl-PL--><gs:InputLanguageID Action="add" ID="0415:00000415" Default="true"/>
<!--pl-PL--><gs:InputLanguageID Action="add" ID="0415:00000415"/>

Added polish programmers keyboard and configured it as default.

List available keyb codes for other countries at :
https://technet.microsoft.com/en-us/library/hh825682.aspx

Please remember using this XML entity does NOT install the display languages. It should only be used for selecting display languages after they have been installed.

When you execute described command , logging  off user may be needed.

Leave a Reply

Twój adres email nie zostanie opublikowany. Pola, których wypełnienie jest wymagane, są oznaczone symbolem *