17

Is is possible to change the keyboard layout via command line on Windows XP/7?

8 Answers 8

13

yes.

Configuring Regional and Language Options International Settings with command line automation

Windows Vista Command Line Configuration of International Settings

command line example:

control intl.cpl,, /f:"%CD%\AddKeyboardLanguage.xml"

AddKeyboardLanguage.xml example:

<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend"> 
<gs:UserList>
<gs:User UserID="Current" CopySettingsToDefaultUserAcct="true" CopySettingsToSystemAcct="true"/></gs:UserList> 
<gs:InputPreferences> 

<!--ch-Google--><gs:InputLanguageID Action="add" ID="0804:E0200804"/>

</gs:InputPreferences>
</gs:GlobalizationServices>

RemoveKeyboardLanguage.xml example:

<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend"> 
<gs:UserList>
<gs:User UserID="Current" CopySettingsToDefaultUserAcct="true" CopySettingsToSystemAcct="true"/></gs:UserList> 
<gs:InputPreferences> 

<!--ch-Google--><gs:InputLanguageID Action="remove" ID="0804:E0200804"/>

</gs:InputPreferences>
</gs:GlobalizationServices>
2
  • 2
    I wonder if there is any command form the cmd just to tell which keyboard layout your are currently using in Windows7? I mean a command that returns a string value of the language layout you are using -- not changing the layout just inquiring.
    – doctorate
    Commented Nov 17, 2014 at 9:02
  • linkrot! updateable?
    – nilon
    Commented Jun 23, 2020 at 17:10
3

Windows 8 brings a new International PowerShell module. Unfortunately it doesn't seem like this can be backported or has any Windows 7 alternative


Configure international settings by using PowerShell cmdlets

In Windows 8 you can use the International Settings PowerShell cmdlets to change the language on a running Windows installation. The benefit of using PowerShell cmdlets is that you can incorporate them into a script to facilitate deployment and configuration of Windows. Source: http://technet.microsoft.com/en-us/library/hh825705.aspx

  1. Open a Windows PowerShell prompt.
  2. Import the international settings module by running the following command:

    ipmo international

  3. Display the locale information on the computer by running the following command:

    Get-WinSystemLocale

  4. Set the locale for the region and language that you want. For example, the following command sets the system locale to Japanese (Japan):

    Set-WinSystemLocale ja-JP

2
  • 3
    This answer changes the locale. It doesn't seem to affect keyboards, at most the codepage will be different.
    – jiggunjer
    Commented Aug 3, 2016 at 1:23
  • 2
    Set-WinUserLanguageList -Force 'ja-JP' will change the keyboard input language. Note the use of -Force is only to not get the popup dialog. Get-WinUserLanguageList will give you the list of languages available to user for typing.
    – yasouser
    Commented May 12, 2017 at 2:26
2

"Windows 8 brings a new International PowerShell module. Unfortunately it doesn't seem like this can be backported or has any Windows 7 alternative"

You could try this (example).. this enables only the selected keyboard layouts and clears the others

Install-Module -name timezone -force
#Sets the systems timezone on "Western Europe Standard time" 
$langlist = New-WinUserLanguageList en-US

#Clears the other input methods from the displayed language
$langlist[0].InputMethodTips.Clear()

#Sets and adds the swiss-German keyboard
$langlist[0].InputMethodTips.add('0409:00000807')

#Sets and adds the swiss-french keyboard
$langlist[0].InputMethodTips.add('0409:0000100C')

#Apply the changes made on the system (and force to avoid the prompt  message)
Set-WinUserLanguageList $langlist -Force
2

No (not via CMD), you will have to change it the following way. There used to be a keyb.com command in DOS but that no longer exists in Windows.

Source:

Windows 7 or Windows Vista

  1. Click Start, type intl.cpl in the Start Search box, and then press ENTER.
  2. On the Keyboards and Language tab, click Change keyboards. Click Add.
  3. Expand the language that you want. For example, expand French (Canada).
  4. Expand Keyboard list, click to select the Canadian French check box, and then click OK.
  5. In the options, click View Layout to compare the layout with the actual keyboard.
  6. In the Default input language list, click French (Canada) – Canadian French, and then click OK two times.
  7. In the Regional and Language Options dialog box, click OK.
  8. Click the Language bar, and then click FR French (Canada).

Windows XP

  1. Click Start , type intl.cpl in the Run box, and then press ENTER.
  2. On the Languages tab, click Details.
  3. Under Installed services, click Add.
  4. In the Input language list, select the language that you want. For example, select French (Canada) .
  5. In the Keyboard layout/IME list, click Canadian French, and then click OK.
  6. In the Select one of the installed input languages to use when you start your computer list, click French (Canada) – Canadian French, and then click OK.
  7. In the Regional and Language Options dialog box, click OK.
  8. Click the Language bar, and then click French (Canada).

But you can in Linux using loadkeys.

2
  • Cheers! +1 to you! :)
    – studiohack
    Commented Mar 1, 2012 at 17:11
  • if you are not admin and normal user, this solved my issue when i click and run as administrator from inside my user. Changing from the administrator account did not solve my issue and the solution was to call intl.cpl with run as administrator. Commented Mar 1, 2021 at 10:04
2

For information: Set-WinUserLanguageList as suggested in other answers does not just change the active keyboard input language, it overwrites your current list of (enabled) input languages. To set up two languages or more that you can switch between, use something along these lines:

Set-WinUserLanguageList -Force en-US,sv-SE

The language given as the first argument to the list will be selected as the active language, so this can be an efficient way to change both active language and the overall list of keyboard languages available.

1
1

First I would like to mention this works on Windows 10, and I will be using Powershell.

Second I'll post here a clean answer from all the information on this thread (and one other) all in one single post.

1- Get the current language list with:

Get-WinUserLanguageList | Format-Table -Property LanguageTag, InputMethodTips

This will print the current available Settings on the system, on my case:

LanguageTag InputMethodTips
----------- ---------------
en-US       {0409:00000409}
nl-BE       {0813:00000813}

2- Now in order to add another language (in my case I wanted to add Portuguese 'pt-PT'):

Set-WinUserLanguageList -Force 'pt-PT', 'en-US', 'nl-BE'

This will leave the previous languages on the list + add the one I need in 1º place, this will make all languages available on the UI and easier to switch keyboards:

enter image description here

The '-Force' option will simply avoid the confirmation prompt.

0
$psdrive = New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS

Set-ItemProperty -Path "HKU:\.DEFAULT\Keyboard Layout\Preload\" -Name 1 -Value 00001033

$psdrive | Remove-PSDrive

This works fine in the Windows 7 PowerShell but you have to logout and back in to enable ist it changes the layout to English if you want another language you have to change the -Value number you can find them here: https://www.science.co.il/language/Locale-codes.php

0

You can do this in Powershell using the following commands.

Change keyboard to Arabic

Set-WinUserLanguageList -LanguageList  ar-eg, en-US -force

Change keyboard to English:

Set-WinUserLanguageList -LanguageList  en-US, ar-EG -force

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .