Adicionando um layout de teclado com prompt de comando no windows 8.1

0

Eu uso um script PowerShell para configurar os idiomas / teclados dos tablets para uma configuração específica. Francês canadense (1) e EUA (2) para teclado, e todas as configurações de idioma / região / formato para francês canadense.

Há alguma redundância, mas funciona:

$DefaultHKEY = "HKU\DEFAULT_USER"
$DefaultRegPath = "C:\Users\Default\NTUSER.DAT"

Set-Culture fr-ca
Set-WinSystemLocale fr-ca
Set-WinHomeLocation -GeoId 39
Set-WinUserLanguageList fr-ca -Force
Set-WinUILanguageOverride fr-ca
reg load $DefaultHKEY $DefaultRegPath
reg import "./langue/fr-ca-default.reg"
reg unload $DefaultHKEY
reg import "./langue/fr-ca-welcome.reg"
cmd.exe /c 'locale.bat'

e este é o script reg (o segundo é o mesmo, exceto que eu uso DEFAULT_USER)

Windows Registry Editor Version 5.00

[HKEY_USERS\.DEFAULT\Control Panel\International]
"Locale"="00000C0C"
"LocaleName"="fr-CA"
"s1159"=""
"s2359"=""
"sCountry"="Canada"
"sCurrency"="$"
"sDate"="-"
"sDecimal"=","
"sGrouping"="3;0"
"sLanguage"="FRC"
"sList"=";"
"sLongDate"="d MMMM yyyy"
"sMonDecimalSep"=","
"sMonGrouping"="3;0"
"sMonThousandSep"=" "
"sNativeDigits"="0123456789"
"sNegativeSign"="-"
"sPositiveSign"=""
"sShortDate"="yyyy-MM-dd"
"sThousand"=" "
"sTime"=":"
"sTimeFormat"="HH:mm:ss"
"sShortTime"="HH:mm"
"sYearMonth"="MMMM, yyyy"
"iCalendarType"="1"
"iCountry"="1"
"iCurrDigits"="2"
"iCurrency"="3"
"iDate"="2"
"iDigits"="2"
"NumShape"="1"
"iFirstDayOfWeek"="6"
"iFirstWeekOfYear"="0"
"iLZero"="1"
"iMeasure"="0"
"iNegCurr"="15"
"iNegNumber"="1"
"iPaperSize"="1"
"iTime"="1"
"iTimePrefix"="0"
"iTLZero"="1"

[HKEY_USERS\.DEFAULT\Control Panel\International\Geo]
"Nation"="39"

[HKEY_USERS\.DEFAULT\Control Panel\International\User Profile]
"Languages"=hex(7):66,00,72,00,2d,00,43,00,41,00,00,00,65,00,6e,00,2d,00,55,00,\
  53,00,00,00
"ShowAutoCorrection"=dword:00000001
"ShowTextPrediction"=dword:00000001
"ShowCasing"=dword:00000001
"ShowShiftLock"=dword:00000001
"UserLocaleFromLanguageProfileOptOut"=dword:00000001
"WindowsOverride"="fr-CA"

[HKEY_USERS\.DEFAULT\Control Panel\International\User Profile\en-US]
"CachedLanguageName"="@Winlangdb.dll,-1121"
"0409:00000409"=dword:00000001

[HKEY_USERS\.DEFAULT\Control Panel\International\User Profile\fr-CA]
"CachedLanguageName"="@Winlangdb.dll,-1160"
"0C0C:00001009"=dword:00000001

[HKEY_USERS\.DEFAULT\Control Panel\International\User Profile System Backup]
"Languages"=hex(7):66,00,72,00,2d,00,43,00,41,00,00,00,65,00,6e,00,2d,00,55,00,\
  53,00,00,00
"ShowAutoCorrection"=dword:00000001
"ShowTextPrediction"=dword:00000001
"ShowCasing"=dword:00000001
"ShowShiftLock"=dword:00000001
"UserLocaleFromLanguageProfileOptOut"=dword:00000001

[HKEY_USERS\.DEFAULT\Control Panel\International\User Profile System Backup\en-US]
"CachedLanguageName"="@Winlangdb.dll,-1121"
"0409:00000409"=dword:00000001

[HKEY_USERS\.DEFAULT\Control Panel\International\User Profile System Backup\fr-CA]
"CachedLanguageName"="@Winlangdb.dll,-1160"
"0C0C:00001009"=dword:00000001

[HKEY_USERS\.DEFAULT\Keyboard Layout]

[HKEY_USERS\.DEFAULT\Keyboard Layout\Preload]
"2"="00000409"
"1"="00000c0c"

[HKEY_USERS\.DEFAULT\Keyboard Layout\Substitutes]
"00000c0c"="00001009"

[HKEY_USERS\.DEFAULT\Keyboard Layout\Toggle]

[HKEY_USERS\.DEFAULT\Control Panel\Desktop\MuiCached]
"MachinePreferredUILanguages"=hex(7):66,00,72,00,2d,00,43,00,41,00,00,00,00,00

[HKEY_USERS\.DEFAULT\Control Panel\Desktop]
"PreferredUILanguages"=hex(7):66,00,72,00,2d,00,43,00,41,00,00,00,00,00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\MUI\Settings]
"PreferredUILanguages"=hex(7):66,00,72,00,2d,00,43,00,41,00,00,00,00,00

e locale.bat executam um simples

control.exe intl.cpl,, /f:".\locale.xml"

O arquivo xml:

<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">

<!-- user list --> 
    <gs:UserList>
        <gs:User UserID="Current" CopySettingsToDefaultUserAcct="true" CopySettingsToSystemAcct="true"/> 
    </gs:UserList>

    <!-- GeoID -->
    <gs:LocationPreferences> 
        <gs:GeoID Value="39"/>
    </gs:LocationPreferences>

    <gs:MUILanguagePreferences>
        <gs:MUILanguage Value="fr-CA"/>
        <gs:MUIFallback Value="en-US"/>
    </gs:MUILanguagePreferences>

    <!-- system locale -->
    <gs:SystemLocale Name="fr-CA"/>

    <!-- input preferences -->
    <gs:InputPreferences>
        <gs:InputLanguageID Action="add" ID="1009:00001009"/>
        <gs:InputLanguageID Action="add" ID="0409:00000409"/>
     </gs:InputPreferences>

    <!-- user locale -->
    <gs:UserLocale>
        <gs:Locale Name="fr-CA" SetAsCurrent="true" ResetAllSettings="false">
        </gs:Locale>
    </gs:UserLocale>
 </gs:GlobalizationServices>

Tudo funciona, exceto por uma coisa e não consigo entender por quê. Por algum motivo, depois de executar meu script. Acabei com apenas um idioma de teclado (francês canadense), não consigo obter o layout dos EUA para adicionar automaticamente. Eu comparei meu arquivo reg com um tablet que tem os dois teclados que eu quero (FRCA e ENUS) e não vejo nenhuma diferença ...?

Qualquer ajuda é apreciada.

    
por user851637 10.12.2017 / 03:12

0 respostas