powershell切换windows显示语言

2022-04-21 22:25:37 浏览数 (1)

cmd /c "reg export HKLMSYSTEMCurrentControlSetControlMUIUILanguages c:lang.reg /y"

$displaylanguage='zh-CN'

#$displaylanguage='en-US'

cmd /c "bcdedit /set {default} locale $displaylanguage"

cmd /c "bcdboot %WinDir% /l $displaylanguage"

function Change-Language1 {

param ($Language)

reg add "HKCUControl PanelDesktop" /f /v "PreferredUILanguages" /t REG_SZ /d $Language

}

function Change-Language2 {

param ($Language)

Set-ItemProperty 'HKCU:Control PanelDesktop' -Name "PreferredUILanguages" -Value $Language

}

Change-Language1 -language $displaylanguage

参考了https://social.technet.microsoft.com/wiki/contents/articles/24450.change-os-language-using-powershell.aspx

0 人点赞