Windows Vista Command Line Configuration of International Settings
A feature new in Windows Vista makes it possible to configure international settings from the command line using an extension of the Regional and Languages Options Control Panel. For example, a network administrator may decide to mandate that all corporate computers in the international branch offices use the ISO standard date format (YYYY-MM-dd). By describing this property in an XML file, the network administrator can create scripts to automate the configuration of the international settings for any Windows Vista installation.
This command-line method of configuring international settings requires Windows Vista. It is bundled into the intl.cpl binary that ships with the operating system.
This article, which is intended for network administrators, explains how to configure international settings from a command line. For information about how to configure international settings during an unattended installation, see the Windows Automated Installation Kit documentation on Microsoft TechNet.
| Overview |
| Using Command Line Configuration of International Settings |
| XML Entity Descriptions |
| Logging |
| Unicode Support |
| Custom Locale and Custom Culture Support |
| Definitions |
| Common Usage Scenarios |
Overview
Windows Vista has a new method of configuring international settings from the command line. Using this feature, you can:
- Change and customize formats of numbers, currency, time, dates, and sorting.
- Change a display language preference.
- Change a location preference.
- Add and remove keyboards.
- Add and remove input method editors (IMEs).
- Change the language for non-Unicode programs (system locale).
- Copy the international settings to Reserved Accounts (local service, network service, local system, and new users).
Using Command Line Configuration of International Settings
To configure international settings, you must first create an XML file. In this file, you specify the settings that you want to configure.
After you have created the XML file, you will use the command line to pass the file to Regional and Language Options for configuration. You can combine all of these XML entities in one XML file.
Accessing the Command Line Configuration |
At the command line prompt, use the following command line arguments (where filename.xml is the full path to the XML file): |
control intl.cpl,, /f:"filename.xml" |
The schema requires that the user list entity be included in all files:
<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">
<!--User List-->
<gs:UserList>
<gs:User UserID="Current"/>
</gs:UserList>
</gs:GlobalizationServices>
To check that your XML is well-formed, open it with Internet Explorer. Internet Explorer will flag any syntax errors for you.
Changing the system locale requires the command prompt to be run with administrator privileges, and this action requires a system restart.
Copying the settings to the default user account and to the system accounts requires the script to be run from a command prompt with administrator privileges.
The XML entity descriptions are outlined in the next section of this article.
XML Entity Descriptions
<gs:UserList> | |
Required |
|
Optional |
|
<gs:LocationPreferences> | |
Optional |
|
<gs:MUILanguagePreferences> | |
Optional |
|
<gs:SystemLocale> | |
Optional |
|
<gs:InputPreferences> | |
Optional |
|
<gs:UserLocale> | |
Optional |
|
* Either Win32 or .NET Framework names can be used in the list of options to set, but either one or the other must be chosen. The list of names is outlined in the table below. The schema does not support a mixture of these names.
Win32 Name | .NET Framework Name | NLS Identifier (LCTYPE) |
sSort | AlternateSort | * LOCALE_SSORTNAME |
sList | ListSeparator | LOCALE_SLIST |
sDecimal | NumberDecimalSeparator | LOCALE_SDECIMAL |
sThousand | NumberGroupSeparator | LOCALE_STHOUSAND |
sGrouping | NumberGroupSizes | LOCALE_SGROUPING |
iDigits | NumberDecimalDigits | LOCALE_IDIGITS |
iNegNumber | NegativeNumberPattern | LOCALE_INEGNUMBER |
sNegativeSign | NegativeSign | LOCALE_SNEGATIVESIGN |
sPositiveSign | PositiveSign | LOCALE_SPOSITIVESIGN |
sCurrency | CurrencySymbol | LOCALE_SCURRENCY |
sMonDecimalSep | CurrencyDecimalSeparator | LOCALE_SMONDECIMALSEP |
sMonThousandSep | CurrencyGroupSeparator | LOCALE_SMONTHOUSANDSEP |
sMonGrouping | CurrencyGroupSizes | LOCALE_SMONGROUPING |
iCurrDigits | CurrencyDecimalDigits | LOCALE_ICURRDIGITS |
iCurrency | CurrencyPositivePattern | LOCALE_ICURRENCY |
iNegCurr | CurrencyNegativePattern | LOCALE_INEGCURR |
iLZero | LeadingZero | LOCALE_ILZERO |
sTimeFormat | TimePattern | LOCALE_STIMEFORMAT |
s1159 | AMDesignator | LOCALE_S1159 |
s2359 | PMDesignator | LOCALE_S2359 |
sShortDate | ShortDatePattern | LOCALE_SSHORTDATE |
sLongDate | LongDatePattern | LOCALE_SLONGDATE |
iCalendarType | Calendar | LOCALE_ICALENDARTYPE |
iFirstDayOfWeek | FirstDayOfWeek | LOCALE_IFIRSTDAYOFWEEK |
iFirstWeekOfYear | CalendarWeekRule | LOCALE_IFIRSTWEEKOFYEAR |
sNativeDigits | NativeDigits | LOCALE_SNATIVEDIGITS |
iDigitSubstitution | DigitSubstitution | LOCALE_IDIGITSUBSTITUTION |
iMeasure | IsMetric | LOCALE_IMEASURE |
* Only supported on formats with alternate sort orders, such as German (Germany).
Logging
Output results are logged in the operational node in the Event Viewer. Output results are not displayed to the screen. This is to facilitate configuration of international settings from a script.
To view entries in the operational log |
|
Unicode Support
Unicode characters may be used where appropriate in the XML configuration file.
Custom Locale and Custom Culture Support
The installation of custom cultures or custom locales is not supported.
If a custom culture or custom locale has been installed using the .NET Framework CARIB (CultureAndRegionInfoBuilder) or by using the installer created by the Custom Locale Builder, you can apply and customize these locales from the command line.
Definitions
Format
Format refers to the currently selected format for the current user on the computer. This is also referred to as user locale. To see a table of user locales, click here.
GeoID
GeoID is an identifier in Windows which represents a geographical location. To see a table of geographical locations, click here.
Keyboard
System Locale
The system locale provides support for programs that do not support Unicode. It enables those programs to display text menus and dialog boxes in the correct language. A table of valid system locales is available here. Any locale in the table where the ANSI code page is equal to 0 and the OEM code page is equal to 1, is not supported as a system locale.
Common Usage Scenarios
The samples below illustrate how specific international settings can be configured from the command line.
Example: Change Format
To change format, you will create an XML file. The following example sets the format to English (United States).
<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">
<!--User List-->
<gs:UserList>
<gs:User UserID="Current"/>
</gs:UserList>
<!--User Locale-->
<gs:UserLocale>
<gs:Locale Name="en-US" SetAsCurrent="true"/>
</gs:UserLocale>
</gs:GlobalizationServices>
Save the XML document, open a Windows Vista command prompt and use the following command line arguments:
control intl.cpl,, /f:"filename.xml"
Where “filename.xml” is the full path to the XML file.
Example: Change and Customize Format (Win32)
To change and customize format, create an XML file. The following example sets the format to English (United States) and configures settings for Win32.
<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">
<!--User List-->
<gs:UserList>
<gs:User UserID="Current"/>
</gs:UserList>
<!-- user locale -->
<gs:UserLocale>
<gs:Locale Name="en-US" SetAsCurrent="true" ResetAllSettings="false">
<gs:Win32>
<gs:iCalendarType>1</gs:iCalendarType>
<gs:sList>;</gs:sList>
<gs:sDecimal>.</gs:sDecimal>
<gs:sThousand> </gs:sThousand>
<gs:sGrouping>1</gs:sGrouping>
<gs:iDigits>3</gs:iDigits>
<gs:iNegNumber>2</gs:iNegNumber>
<gs:sNegativeSign>-</gs:sNegativeSign>
<gs:sPositiveSign>+</gs:sPositiveSign>
<gs:sCurrency>$</gs:sCurrency>
<gs:sMonDecimalSep>.</gs:sMonDecimalSep>
<gs:sMonThousandSep>,</gs:sMonThousandSep>
<gs:sMonGrouping>3</gs:sMonGrouping>
<gs:iCurrDigits>1</gs:iCurrDigits>
<gs:iCurrency>3</gs:iCurrency>
<gs:iNegCurr>3</gs:iNegCurr>
<gs:iLZero>0</gs:iLZero>
<gs:sTimeFormat>:HH:m:s tt</gs:sTimeFormat>
<gs:s1159>a.m.</gs:s1159>
<gs:s2359>p.m.</gs:s2359>
<gs:sShortDate>d/M/yy</gs:sShortDate>
<gs:sLongDate>dddd, MMMM yyyy</gs:sLongDate>
<gs:iFirstDayOfWeek>6</gs:iFirstDayOfWeek>
<gs:iFirstWeekOfYear>2</gs:iFirstWeekOfYear>
<gs:sNativeDigits>012345789</gs:sNativeDigits>
<gs:iDigitSubstitution>1</gs:iDigitSubstitution>
<gs:iMeasure>0</gs:iMeasure>
<gs:iTwoDigitYearMax>2049</gs:iTwoDigitYearMax>
</gs:Win32>
</gs:Locale>
</gs:UserLocale>
</gs:GlobalizationServices>
Save the XML document, open a Windows Vista command prompt and use the following command line arguments:
control intl.cpl,, /f:"filename.xml"
Where “filename.xml” is the full path to the XML file.
Example: Change and Customize Format (.NET Framework)
To change and customize format for .NET Framework, create an XML file. The following example sets the format to English (United States) and configures format settings for .NET framework
<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">
<!--User List-->
<gs:UserList>
<gs:User UserID="Current"/>
</gs:UserList>
<!-- user locale -->
<gs:UserLocale>
<gs:Locale Name="en-US" SetAsCurrent="true" ResetAllSettings="false">
<gs:Framework>
<gs:ListSeparator>;</gs:ListSeparator>
<gs:NumberDecimalSeparator>.</gs:NumberDecimalSeparator>
<gs:NumberGroupSeparator> </gs:NumberGroupSeparator>
<gs:NumberGroupSizes>1</gs:NumberGroupSizes>
<gs:NumberDecimalDigits>3</gs:NumberDecimalDigits>
<gs:NegativeNumberPattern>2</gs:NegativeNumberPattern>
<gs:NegativeSign>-</gs:NegativeSign>
<gs:PositiveSign>+</gs:PositiveSign>
<gs:CurrencySymbol>$</gs:CurrencySymbol>
<gs:CurrencyDecimalSeparator>.</gs:CurrencyDecimalSeparator>
<gs:CurrencyGroupSeparator> </gs:CurrencyGroupSeparator>
<gs:CurrencyGroupSizes>1</gs:CurrencyGroupSizes>
<gs:CurrencyDecimalDigits>3</gs:CurrencyDecimalDigits>
<gs:CurrencyPositivePattern>3 </gs:CurrencyPositivePattern>
<gs:CurrencyNegativePattern>3</gs:CurrencyNegativePattern>
<gs:LeadingZero>0</gs:LeadingZero>
<gs:LongTimePattern>:HH:m:s tt:</gs:LongTimePattern>
<gs:AMDesignator>a.m.</gs:AMDesignator>
<gs:PMDesignator>p.m.</gs:PMDesignator>
<gs:ShortDatePattern>d/M/yy</gs:ShortDatePattern>
<gs:LongDatePattern>dddd, MMMM yyyy</gs:LongDatePattern>
<gs:Calendar>1</gs:Calendar>
<gs:FirstDayOfWeek>6</gs:FirstDayOfWeek>
<gs:CalendarWeekRule>2</gs:CalendarWeekRule>
<gs:NativeDigits>012345789</gs:NativeDigits>
<gs:DigitSubstitution>1</gs:DigitSubstitution>
<gs:IsMetric>0</gs:IsMetric>
</gs:Framework>
</gs:Locale>
</gs:UserLocale>
</gs:GlobalizationServices>
Save the XML document, open a Windows Vista command prompt and use the following command line arguments:
control intl.cpl,, /f:"filename.xml"
Where “filename.xml” is the full path to the XML file.
Example: Change Current User Display Language
To change the current user’s display language, create an XML file. If this setting is not configured, the display language for new accounts will default to the display language of the computer.
The following example sets the display language to Arabic. In this case, the Arabic language is not fully localized and the display language fallback is set to Spanish. This is the language used when Arabic localized resources are not available.
<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">
<!--User List-->
<gs:UserList>
<gs:User UserID="Current"/>
</gs:UserList>
<!—Display Language-->
<gs:MUILanguagePreferences>
<gs:MUILanguage Value="ar-DZ" />
<gs:MUIFallback Value="es-ES" />
</gs:MUILanguagePreferences>
</gs:GlobalizationServices>
Save the XML document, open a Windows Vista command prompt and use the following command line arguments:
control intl.cpl,, /f:"filename.xml"
Where “filename.xml” is the full path to the XML file.
Log off, and then log on to view the changes.
Example: Change Display Language for the User’s Computer
These settings will change the current user’s display language, and then copy these settings to the system accounts. This will also update the display language for the Welcome screen. This becomes the default display language for all user accounts that do have not a display language configured.
To change the computer’s display language, create an XML file. The following example sets the display language to Arabic. In this case, the Arabic language is not fully localized and the display language fallback is set to Spanish. This is the language used when Arabic localized resources are not available.
<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">
<!--User List-->
<gs:UserList>
<gs:User UserID="Current" CopySettingsToSystemAcct="true" />
</gs:UserList>
<!—Display Language-->
<gs:MUILanguagePreferences>
<gs:MUILanguage Value="ar-DZ" />
<gs:MUIFallback Value="es-ES" />
</gs:MUILanguagePreferences>
</gs:GlobalizationServices>
Save the XML document, open an elevated Windows Vista command prompt and use the following command line arguments:
control intl.cpl,, /f:"filename.xml"
Where “filename.xml” is the full path to the XML file.
Example: Change Display Language for New Accounts
These settings will change the current user’s display language, and then copy the settings to the default user account. If this setting is not configured, the display language for new accounts will default to the display language of the computer.
To change the display language for new accounts, create an XML file. The following example sets the display language to Arabic and the display language fallback to Spanish.
<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">
<!--User List-->
<gs:UserList>
<gs:User UserID="Current" CopySettingsToSystemAcct="true" />
</gs:UserList>
<!—Display Language-->
<gs:MUILanguagePreferences>
<gs:MUILanguage Value="ar-DZ" />
<gs:MUIFallback Value="es-ES" />
</gs:MUILanguagePreferences>
</gs:GlobalizationServices>
Save the XML document, open an elevated Windows Vista command prompt and use the following command line arguments:
control intl.cpl,, /f:"filename.xml"
Where “filename.xml” is the full path to the XML file.
Example: Change Keyboards
To change keyboards, create an XML file as shown in the following example.
<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">
<!--User List-->
<gs:UserList>
<gs:User UserID="Current"/>
</gs:UserList>
<!--input preferences-->
<gs:InputPreferences>
<!--en-US-->
<gs:InputLanguageID Action="add" ID="0409:00000409" Default="true"/>
<!--de-DE-->
<gs:InputLanguageID Action="remove" ID="0407:00000407"/>
<!--bs-BA-Latn-->
<gs:InputLanguageID Action="add" ID="141a:0000041a"/>
<!--cy-GB-->
<gs:InputLanguageID Action="add" ID="0452:00000452"/>
<!--en-GB-->
<gs:InputLanguageID Action="add" ID="0809:00000809"/>
</gs:InputPreferences>
</gs:GlobalizationServices>
Save the XML document, open a Windows Vista command prompt and use the following command line arguments:
control intl.cpl,, /f:"filename.xml"
Where “filename.xml” is the full path to the XML file.
To update the keyboard settings for the Welcome screen, set the following attribute:
CopySettingsToSystemAcct="true" in <gs:User>
Example: Change System Locale
To change system locale, create an XML file. The following example changes the system locale to German.
<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">
<!--User List-->
<gs:UserList>
<gs:User UserID="Current"/>
</gs:UserList>
<!--location-->
<gs:LocationPreferences>
<gs:GeoID Value="94"/>
</gs:LocationPreferences>
</gs:GlobalizationServices>
Save the XML document, open a Windows Vista command prompt and use the following command line argument:
CopySettingsToSystemAcct="true" in <gs:User>
Where “filename.xml” is the full path to the XML file.
No hay comentarios:
Publicar un comentario