0

I have a preconfigured Windows 10 VM provisioned by a cloud computing service.

All Win10 images provided by this service have English (US) set as the default system language. I have no control over this.

What I want to do is to write a script that changes the system locale (including display language, time zone, culture info etc. etc.) to a different locale, e.g. German (Germany).

The requirements are

  • that the switch must be fully automated, so no manual user interaction must be necessary (i.e. no manually downloading anything, or changing anything in a system settings dialogue).
  • that the changes must be permanent (i.e. survive a reboot of the VM).

How do I do that?

2
  • Aren't VM image instances, by definition, temporary? Since you don't control the VM, any changes to the system will never survive a reboot.
    – Casey
    Commented Mar 14, 2021 at 17:33
  • Setting the locale for the region and language, for example, to Japanese: Set-WinSystemLocale ja-JP.
    – harrymc
    Commented Mar 14, 2021 at 19:43

1 Answer 1

0

I found an article about it.

Edit: It seems, there is a explaining page: https://renenyffenegger.ch/notes/Windows/registry/tree/HKEY_CURRENT_USER/Control-Panel/International/index

The original author got onto following solution, changed first part for your de-DE:

$DefaultHKEY = "HKU\DEFAULT_USER"
$DefaultRegPath = "C:\Users\Default\NTUSER.DAT"
Set-Culture de-DE
Set-WinSystemLocale de-DE
Set-WinHomeLocation -GeoId 94 # Germany (see https://docs.microsoft.com/de-ch/windows/win32/intl/table-of-geographical-locations)
Set-WinUserLanguageList de-DE
reg load $DefaultHKEY $DefaultRegPath
reg import ".\de-DE-default.reg"
reg unload $DefaultHKEY
reg import ".\de-DE-welcome.reg"

and the registry files:

Windows Registry Editor Version 5.00

[HKEY_USERS\DEFAULT_USER\Control Panel\International]
"Locale"="00000407" ; source: https://renenyffenegger.ch/notes/Windows/development/Internationalization/language#windows-language-id
"LocaleName"="de-DE"
;"s1159"="AM"
;"s2359"="PM"
"sCountry"="Germany"
"sCurrency"="€"
"sDate"="/"
"sDecimal"="."
"sGrouping"="3;0"
"sLanguage"="ENG"
"sList"=","
"sLongDate"="dd MMMM yyyy"
"sMonDecimalSep"="."
"sMonGrouping"="3;0"
"sMonThousandSep"=","
"sNativeDigits"="0123456789"
"sNegativeSign"="-"
"sPositiveSign"="+"
"sShortDate"="dd/MM/yyyy"
"sThousand"=","
"sTime"=":"
"sTimeFormat"="HH:mm:ss"
"sShortTime"="HH:mm"
"sYearMonth"="MMMM yyyy"
"iCalendarType"="1"
"iCountry"="44"
"iCurrDigits"="2"
"iCurrency"="0"
"iDate"="1"
"iDigits"="2"
"NumShape"="1"
"iFirstDayOfWeek"="0"
"iFirstWeekOfYear"="2"
"iLZero"="1"
"iMeasure"="0"
"iNegCurr"="1"
"iNegNumber"="1"
"iPaperSize"="9"
"iTime"="1"
"iTimePrefix"="0"
"iTLZero"="1"

[HKEY_USERS\DEFAULT_USER\Control Panel\International\Geo]
"Nation"="242"

[HKEY_USERS\DEFAULT_USER\Control Panel\International\User Profile]
"Languages"=hex(7):65,00,6e,00,2d,00,47,00,42,00,00,00
"ShowAutoCorrection"=dword:00000001
"ShowTextPrediction"=dword:00000001
"ShowCasing"=dword:00000001
"ShowShiftLock"=dword:00000001

[HKEY_USERS\DEFAULT_USER\Control Panel\International\User Profile\en-GB]
"CachedLanguageName"="@Winlangdb.dll,-1110"
"0809:00000809"=dword:00000001

[HKEY_USERS\DEFAULT_USER\Control Panel\International\User Profile System Backup]
"Languages"=hex(7):65,00,6e,00,2d,00,47,00,42,00,00,00
"ShowAutoCorrection"=dword:00000001
"ShowTextPrediction"=dword:00000001
"ShowCasing"=dword:00000001
"ShowShiftLock"=dword:00000001

[HKEY_USERS\DEFAULT_USER\Control Panel\International\User Profile System Backup\en-GB]
"CachedLanguageName"="@Winlangdb.dll,-1110"
"0809:00000809"=dword:00000001

[HKEY_USERS\DEFAULT_USER\Keyboard Layout]

[HKEY_USERS\DEFAULT_USER\Keyboard Layout\Preload]
"1"="00000809"

[HKEY_USERS\DEFAULT_USER\Keyboard Layout\Substitutes]

[HKEY_USERS\DEFAULT_USER\Keyboard Layout\Toggle]

[HKEY_USERS\DEFAULT_USER\Control Panel\Desktop\MuiCached]
"MachinePreferredUILanguages"=hex(7):65,00,6e,00,2d,00,47,00,42,00,00,00,00,00

[HKEY_USERS\DEFAULT_USER\Control Panel\Desktop]
"PreferredUILanguages"=hex(7):65,00,6e,00,2d,00,47,00,42,00,00,00
Windows Registry Editor Version 5.00

[HKEY_USERS\.DEFAULT\Control Panel\International]
"Locale"="00000809"
"LocaleName"="en-GB"
"s1159"="AM"
"s2359"="PM"
"sCountry"="United Kingdom"
"sCurrency"="£"
"sDate"="/"
"sDecimal"="."
"sGrouping"="3;0"
"sLanguage"="ENG"
"sList"=","
"sLongDate"="dd MMMM yyyy"
"sMonDecimalSep"="."
"sMonGrouping"="3;0"
"sMonThousandSep"=","
"sNativeDigits"="0123456789"
"sNegativeSign"="-"
"sPositiveSign"="+"
"sShortDate"="dd/MM/yyyy"
"sThousand"=","
"sTime"=":"
"sTimeFormat"="HH:mm:ss"
"sShortTime"="HH:mm"
"sYearMonth"="MMMM yyyy"
"iCalendarType"="1"
"iCountry"="44"
"iCurrDigits"="2"
"iCurrency"="0"
"iDate"="1"
"iDigits"="2"
"NumShape"="1"
"iFirstDayOfWeek"="0"
"iFirstWeekOfYear"="2"
"iLZero"="1"
"iMeasure"="0"
"iNegCurr"="1"
"iNegNumber"="1"
"iPaperSize"="9"
"iTime"="1"
"iTimePrefix"="0"
"iTLZero"="1"

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

[HKEY_USERS\.DEFAULT\Control Panel\International\User Profile]
"Languages"=hex(7):65,00,6e,00,2d,00,47,00,42,00,00,00
"ShowAutoCorrection"=dword:00000001
"ShowTextPrediction"=dword:00000001
"ShowCasing"=dword:00000001
"ShowShiftLock"=dword:00000001

[HKEY_USERS\.DEFAULT\Control Panel\International\User Profile\en-GB]
"CachedLanguageName"="@Winlangdb.dll,-1110"
"0809:00000809"=dword:00000001

[HKEY_USERS\.DEFAULT\Control Panel\International\User Profile System Backup]
"Languages"=hex(7):65,00,6e,00,2d,00,47,00,42,00,00,00
"ShowAutoCorrection"=dword:00000001
"ShowTextPrediction"=dword:00000001
"ShowCasing"=dword:00000001
"ShowShiftLock"=dword:00000001

[HKEY_USERS\.DEFAULT\Control Panel\International\User Profile System Backup\en-GB]
"CachedLanguageName"="@Winlangdb.dll,-1110"
"0809:00000809"=dword:00000001

[HKEY_USERS\.DEFAULT\Keyboard Layout]

[HKEY_USERS\.DEFAULT\Keyboard Layout\Preload]
"1"="00000809"

[HKEY_USERS\.DEFAULT\Keyboard Layout\Substitutes]

[HKEY_USERS\.DEFAULT\Keyboard Layout\Toggle]

[HKEY_USERS\.DEFAULT\Control Panel\Desktop\MuiCached]
"MachinePreferredUILanguages"=hex(7):65,00,6e,00,2d,00,47,00,42,00,00,00,00,00

[HKEY_USERS\.DEFAULT\Control Panel\Desktop]
"PreferredUILanguages"=hex(7):65,00,6e,00,2d,00,47,00,42,00,00,00
3
  • I only wanted to inform you about the alternative, I wrote, If you can't use answer files, use the following answer. I hope it still helps somewhat.
    – Dani
    Commented Mar 14, 2021 at 17:26
  • When I try to "reg load $DefaultHKEY $DefaultRegPath", I get "invalid key name" because there is no registry key "HKU/DEFAULT_USER". The keys under "HKey_users" all look like "S-1-5-19" etc.
    – ronin667
    Commented Mar 14, 2021 at 17:53
  • Your answer might be correct or not, but as I found out, on the platform providing the Windows image (which is actually Server 2016, not Windows 10, as I thought orignally), changing the language is not supported because that would require downloading a language pack from the Windows Update server, which is disabled on this particular platform's VMs.
    – ronin667
    Commented Apr 5, 2021 at 14:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .