Como alterar a região do sistema no Windows 2003 usando a linha de comando

4

Existe algum utilitário de linha de comando para alterar a localidade do sistema no Windows 2003?

    
por Jeff Atwood 23.09.2008 / 23:53

2 respostas

2

Não há API do Win32 ou Scripting (WMI) para alternar a localidade do sistema. No entanto, você pode usar esta linha de comando para fazer isso:

rundll32 shell32, Control_RunDLL intl.cpl,,/f:”c:\locale.txt”

O conteúdo de C: \ locale.txt se parece com:

[RegionalSettings]

LanguageGroup=13

SystemLocale=0401

UserLocale=0401

InputLocale=0409:00000409,0401:00000401

(Isso mudará a localidade do sistema e do usuário para o árabe - Arábia Saudita e adicionará o teclado árabe).

Extraído do Microsoft KB

    
por 24.09.2008 / 00:25
2

Eu não sei de um utilitário de linha de comando que faz isso estritamente, mas você pode usar um pouco de VBScript para alterar os valores do registro associados. Não é tão simples quanto alterar a localidade na guia Geral da caixa de diálogo Opções regionais e de idioma, mas funciona.

Por exemplo, para alterar as configurações para "English (United Kingdom)", você pode usar algo assim:

Dim WSHShell
Set WSHShell = CreateObject("Wscript.Shell")

WSHShell.RegWrite "HKCU\Control Panel\International\iCountry", "44", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iCurrDigits", "2", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iCurrency", "0", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iDate", "1", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iDigits", "2", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iLZero", "1", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iMeasure", "0", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iNegCurr", "1", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iTime", "1", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iTLZero", "1", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\Locale", "00000809", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\s1159", "AM", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\s2359", "PM", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sCountry", "United Kingdom", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sCurrency", "£", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sDate", "/", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sDecimal", ".", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sLanguage", "ENG", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sList", ",", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sLongDate", "dd MMMM yyyy", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sShortDate", "dd/MM/yyyy", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sThousand", ",", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sTime", ":", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\DefaultBlindDialFlag", "00", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sTimeFormat", "HH:mm:ss", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iTimePrefix", "0", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sMonDecimalSep", ".", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sMonThousandSep", ",", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iNegNumber", "1", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sNativeDigits", "0123456789", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\NumShape", "1", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iCalendarType", "1", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iFirstDayOfWeek", "0", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\iFirstWeekOfYear", "0", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sGrouping", "3;0", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sMonGrouping", "3;0", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sPositiveSign", "", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\sNegativeSign", "-", "REG_SZ"
WSHShell.RegWrite "HKCU\Control Panel\International\Geo\Nation", "244", "REG_SZ"
    
por 24.09.2008 / 00:28