Change the *ONLY* input keyboard programatically

tom T 21 Reputation points
2020-10-22T12:49:59.83+00:00

Hi all,

I have a multi language build with a load of languages.

What I want to do is to grammatically set the input based on a WMI query.

I have the WMI query for win32_keyboard layout and thats great, but I cant seem to set the keyboard without removing all the other keyboards that are available.

Get-WinUserLanguageList shows this:

PS C:\WINDOWS\system32> Get-WinUserLanguageList

LanguageTag : en-GB
Autonym : English (United Kingdom)
EnglishName : English
LocalizedName : English (United Kingdom)
ScriptName : Latin
InputMethodTips : {0809:00000809}
Spellchecking : True
Handwriting : False

LanguageTag : fr-CN
Autonym :
EnglishName : French (fr-CN)
LocalizedName : French (fr-CN)
ScriptName : Latin
InputMethodTips : {2000:0000040C}
Spellchecking : True
Handwriting : False

LanguageTag : de-CN
Autonym :
EnglishName : German (de-CN)
LocalizedName : German (de-CN)
ScriptName : Latin
InputMethodTips : {2400:00000407}
Spellchecking : True
Handwriting : False

LanguageTag : pl
Autonym : polski
EnglishName : Polish
LocalizedName : Polish
ScriptName : Latin
InputMethodTips : {0415:00000415}
Spellchecking : True
Handwriting : False

LanguageTag : nb
Autonym : norsk (bokmål)
EnglishName : Norwegian (Bokmål)
LocalizedName : Norwegian (Bokmål)
ScriptName : Latin
InputMethodTips : {0414:00000414}
Spellchecking : True
Handwriting : False

LanguageTag : it-IT
Autonym : italiano (Italia)
EnglishName : Italian
LocalizedName : Italian (Italy)
ScriptName : Latin
InputMethodTips : {0410:00000410}
Spellchecking : True
Handwriting : False

LanguageTag : sv-SE
Autonym : svenska (Sverige)
EnglishName : Swedish
LocalizedName : Swedish (Sweden)
ScriptName : Latin
InputMethodTips : {041D:0000041D}
Spellchecking : True
Handwriting : False

LanguageTag : en-US
Autonym : English (United States)
EnglishName : English
LocalizedName : English (United States)
ScriptName : Latin
InputMethodTips : {0409:00000409}
Spellchecking : True
Handwriting : False

PS C:\WINDOWS\system32>

For example I can run :

Set-WinUserLanguageList -LanguageList fr-CH -Force

But then Get-WinUserLanguageList shows this:

PS C:\WINDOWS\system32> Get-WinUserLanguageList

LanguageTag : fr-CH
Autonym : français (Suisse)
EnglishName : French
LocalizedName : French (Switzerland)
ScriptName : Latin
InputMethodTips : {100C:0000100C}
Spellchecking : True
Handwriting : False

PS C:\WINDOWS\system32>

And the language bar disappears and the user cannot select a different keyboard or language .

How can I change or set ONLY the keyboard and leave all the display and local settings as they where?

Thanks Tom.

Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sean Liming 4,766 Reputation points Volunteer Moderator
    2020-10-22T15:54:19.577+00:00

    You want to relist "all" the languages with the default language first:

    Set-WinUserLanguageList -LanguageList fr-CH, en-GB, pl, nb, it-IT, sv-SE, en-US -Force

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.