1.

Solve : How to get active keyboard layout in command line??

Answer» <html><body><p>Hi!<br/><br/>I found over the net that in Windows 7 was possible in command line to get active <a href="https://interviewquestions.tuteehub.com/tag/keyboard-532411" style="font-weight:bold;" target="_blank" title="Click to know more about KEYBOARD">KEYBOARD</a> layout.<br/>By this Registry reading:<br/><br/>reg query "HKEY_CURRENT_USER\Keyboard Layout\Preload"<br/><br/>It displays installed layouts (not languages) in system, active will contain number 1.<br/>I used it and tried - no change of value. For to be sure I was searching for ID list - yes, found, but I have own layouts created with KbdEdit. These cannot to have any common ID, so I think I need only one simple thing - <a href="https://interviewquestions.tuteehub.com/tag/read-619994" style="font-weight:bold;" target="_blank" title="Click to know more about READ">READ</a> only active keyboard indication instead list with values without change - value I'll get I will take as important.<br/><br/>How to fix it? Or exist other way?<br/>Thank you all.<br/>MiroHi  <br/>You can find <a href="http://www.orbus.be/bosanski_jezik/language_codes.htm">the language <a href="https://interviewquestions.tuteehub.com/tag/codes-248149" style="font-weight:bold;" target="_blank" title="Click to know more about CODES">CODES</a> here</a><br/>May be those powershell commands can give you an idea   <br/>You can execute it by cmd like this : <br/>This command returns the language list for the current user <a href="https://interviewquestions.tuteehub.com/tag/account-25640" style="font-weight:bold;" target="_blank" title="Click to know more about ACCOUNT">ACCOUNT</a> and the corresponding display name.<br/> Code: <a>[<a href="https://interviewquestions.tuteehub.com/tag/select-630282" style="font-weight:bold;" target="_blank" title="Click to know more about SELECT">SELECT</a>]</a>powershell -C Get-WinUserLanguageListThis command returns the list of currently enabled input methods as a TIP string.<br/> Code: <a>[Select]</a>Powershell -C (Get-WinUserLanguageList)[0].InputMethodTipsThis command returns the autonym property of the first item in the user language list.<br/> Code: <a>[Select]</a>Powershell -C (Get-WinUserLanguageList)[0].autonymDocumentation about <a href="https://docs.microsoft.com/en-us/powershell/module/international/get-winuserlanguagelist?view=win10-ps"><strong>Get-WinUserLanguageList</strong></a><br/>You can make a batch file like this :<br/> Code: <a>[Select]</a>echo off<br/>Title How to get active keyboard layout in command line ?<br/>for /f  %%a in ('Powershell -C (Get-WinUserLanguageList^)[0].InputMethodTips') do Set "IMT=%%a"<br/> echo Active KeyBoard Code = %IMT%<br/><br/>for /f  %%b in ('Powershell -C (Get-WinUserLanguageList^)[0].autonym') do set "CurrentLang=%%b"<br/> echo Active KeyBoard Language = %CurrentLang%<br/>pause<br/>Batch displays language but it looks inactive - I select other layout and no change.<br/><br/>Miro</p></body></html>


Discussion

No Comment Found