Windows Command Line – How to Change Keyboard Layout via cmd.exe on XP/7

command linekeyboard-layoutwindowswindows 7windows xp

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

Best Answer

yes.

http://blogs.msdn.com/b/shawnste/archive/2007/04/12/configuring-international-settings-from-the-command-line.aspx

http://msdn.microsoft.com/en-us/goglobal/bb964650#eyb

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>
Related Question