widsnet.com
6Oct/110

Locale do not match LocaleName

When installing Windows 7 with MDT 2010 and ConfigMgr 2007 there is a bug when changing the Locale for the user.
The Locale variables used in MDT 2010 when running "%scriptroot%\zticonfigure.wsf" are KeyboardLocale, SystemLocale, UILocale and UserLocale.

Assume the build image are using UserLocale=en-US but during deployment we change this to UserLocale=sv-SE. The unattend.xml will be updated with the new value and when any user first log on to the computer it looks like it is set to sv-SE.

One way to spot the problem is to run Print-> Page Setup in MSPaint. The Margins will be set to "inches" instead of "millimeters".
And the problem can be seen in the registry under "HKCU\Control Panel\International\LocaleName" which in this scenario will be set to "sv-SE" but "HKCU\Control Panel\International\Locale" will be "00000409" (1033) which is en-US.

the work around is to open "Region and Language" and under "Formats:" change to anything and press "Apply" and then change back to what you are using and press "OK".

The more automated work around is to run this script in the OS Deployment Task Sequence.

I've had a case regarding this with Microsoft but they wont fix the problem since a manual work around exist. I'am trying to get them to release this as a KB so that others with the same problem can find this work around. This automated work around that is. Not the manual one.

Command Line to run in the OSD TS somewhere after "Setup Windows and ConfigMgr":
cscript "%ScriptRoot%\ZTILocaleFix.vbs"

' // ***************************************************************************
' // 
' // Fixing default user profile when using a different locale than en-US.
' //
' // File:      ZTILocaleFix.vbs
' // 
' // Version:   1.1.0.0
' // 
' // Changes:   1.0.0.0 First version
' //            1.1.0.0 Changed chart used for LocaleName and Locale values
' //
' // Purpose:   Make Locale work with LocaleName.
' // 
' // Usage:     cscript.exe ZTILocaleFix.vbs
' // 
' // ***************************************************************************

Set objShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strDefaultUserHive = "C:\Users\Default\NTUSER.DAT"
strTempReg = "HKEY_USERS\DefaultHive"

LogThis "Checking for file: " & strDefaultUserHive
If Not objFSO.FileExists(strDefaultUserHive) Then
	LogThis "File not found!"
	WScript.Quit 2
End If

LogThis "Loading Default User Hive into " & strTempReg
objShell.Run("Reg.exe load " & strTempReg & " " & strDefaultUserHive), 0, True
LogThis "Reading Locale and LocaleName from Default User Hive"
strLocaleName = objShell.RegRead(strTempReg & "\Control Panel\International\LocaleName")
strLocale = objShell.RegRead(strTempReg & "\Control Panel\International\Locale")
LogThis "LocaleName: " & strLocaleName
LogThis "Locale: " & strLocale

LogThis "Finding correct Locale based on LocaleName"
' Previous chart http://msdn.microsoft.com/en-us/library/0h88fahh(v=vs.85).aspx
' New chart from http://msdn.microsoft.com/en-us/library/cc233968(v=PROT.10).aspx
Select Case strLocaleName
	Case "ar": strCorrectLocale = "0001"
	Case "bg": strCorrectLocale = "0002"
	Case "ca": strCorrectLocale = "0003"
	Case "zh-Hans": strCorrectLocale = "0004"
	Case "zh-Hant": strCorrectLocale = "7c04"
	Case "cs": strCorrectLocale = "0005"
	Case "da": strCorrectLocale = "0006"
	Case "de": strCorrectLocale = "0007"
	Case "el": strCorrectLocale = "0008"
	Case "en": strCorrectLocale = "0009"
	Case "es": strCorrectLocale = "000a"
	Case "fi": strCorrectLocale = "000b"
	Case "fr": strCorrectLocale = "000c"
	Case "he": strCorrectLocale = "000d"
	Case "hu": strCorrectLocale = "000e"
	Case "is": strCorrectLocale = "000f"
	Case "it": strCorrectLocale = "0010"
	Case "ja": strCorrectLocale = "0011"
	Case "ko": strCorrectLocale = "0012"
	Case "nl": strCorrectLocale = "0013"
	Case "no": strCorrectLocale = "0014"
	Case "pl": strCorrectLocale = "0015"
	Case "pt": strCorrectLocale = "0016"
	Case "rm": strCorrectLocale = "0017"
	Case "ro": strCorrectLocale = "0018"
	Case "ru": strCorrectLocale = "0019"
	Case "hr": strCorrectLocale = "001a"
	Case "sk": strCorrectLocale = "001b"
	Case "sq": strCorrectLocale = "001c"
	Case "sv": strCorrectLocale = "001d"
	Case "th": strCorrectLocale = "001e"
	Case "tr": strCorrectLocale = "001f"
	Case "ur": strCorrectLocale = "0020"
	Case "id": strCorrectLocale = "0021"
	Case "uk": strCorrectLocale = "0022"
	Case "be": strCorrectLocale = "0023"
	Case "sl": strCorrectLocale = "0024"
	Case "et": strCorrectLocale = "0025"
	Case "lv": strCorrectLocale = "0026"
	Case "lt": strCorrectLocale = "0027"
	Case "tg": strCorrectLocale = "0028"
	Case "fa": strCorrectLocale = "0029"
	Case "vi": strCorrectLocale = "002a"
	Case "hy": strCorrectLocale = "002b"
	Case "az": strCorrectLocale = "002c"
	Case "eu": strCorrectLocale = "002d"
	Case "hsb": strCorrectLocale = "002e"
	Case "mk": strCorrectLocale = "002f"
	Case "tn": strCorrectLocale = "0032"
	Case "xh": strCorrectLocale = "0034"
	Case "zu": strCorrectLocale = "0035"
	Case "af": strCorrectLocale = "0036"
	Case "ka": strCorrectLocale = "0037"
	Case "fo": strCorrectLocale = "0038"
	Case "hi": strCorrectLocale = "0039"
	Case "mt": strCorrectLocale = "003a"
	Case "se": strCorrectLocale = "003b"
	Case "ga": strCorrectLocale = "003c"
	Case "ms": strCorrectLocale = "003e"
	Case "kk": strCorrectLocale = "003f"
	Case "ky": strCorrectLocale = "0040"
	Case "sw": strCorrectLocale = "0041"
	Case "tk": strCorrectLocale = "0042"
	Case "uz": strCorrectLocale = "0043"
	Case "tt": strCorrectLocale = "0044"
	Case "bn": strCorrectLocale = "0045"
	Case "pa": strCorrectLocale = "0046"
	Case "gu": strCorrectLocale = "0047"
	Case "or": strCorrectLocale = "0048"
	Case "ta": strCorrectLocale = "0049"
	Case "te": strCorrectLocale = "004a"
	Case "kn": strCorrectLocale = "004b"
	Case "ml": strCorrectLocale = "004c"
	Case "as": strCorrectLocale = "004d"
	Case "mr": strCorrectLocale = "004e"
	Case "sa": strCorrectLocale = "004f"
	Case "mn": strCorrectLocale = "0050"
	Case "bo": strCorrectLocale = "0051"
	Case "cy": strCorrectLocale = "0052"
	Case "km": strCorrectLocale = "0053"
	Case "lo": strCorrectLocale = "0054"
	Case "gl": strCorrectLocale = "0056"
	Case "kok": strCorrectLocale = "0057"
	Case "syr": strCorrectLocale = "005a"
	Case "si": strCorrectLocale = "005b"
	Case "iu": strCorrectLocale = "005d"
	Case "am": strCorrectLocale = "005e"
	Case "tzm": strCorrectLocale = "005f"
	Case "ne": strCorrectLocale = "0061"
	Case "fy": strCorrectLocale = "0062"
	Case "ps": strCorrectLocale = "0063"
	Case "fil": strCorrectLocale = "0064"
	Case "dv": strCorrectLocale = "0065"
	Case "ha": strCorrectLocale = "0068"
	Case "yo": strCorrectLocale = "006a"
	Case "quz": strCorrectLocale = "006b"
	Case "nso": strCorrectLocale = "006c"
	Case "ba": strCorrectLocale = "006d"
	Case "lb": strCorrectLocale = "006e"
	Case "kl": strCorrectLocale = "006f"
	Case "ig": strCorrectLocale = "0070"
	Case "ii": strCorrectLocale = "0078"
	Case "arn": strCorrectLocale = "007a"
	Case "moh": strCorrectLocale = "007c"
	Case "br": strCorrectLocale = "007e"
	Case "ug": strCorrectLocale = "0080"
	Case "mi": strCorrectLocale = "0081"
	Case "oc": strCorrectLocale = "0082"
	Case "co": strCorrectLocale = "0083"
	Case "gsw": strCorrectLocale = "0084"
	Case "sah": strCorrectLocale = "0085"
	Case "qut": strCorrectLocale = "0086"
	Case "rw": strCorrectLocale = "0087"
	Case "wo": strCorrectLocale = "0088"
	Case "prs": strCorrectLocale = "008c"
	Case "gd": strCorrectLocale = "0091"
	Case "ar-SA": strCorrectLocale = "0401"
	Case "bg-BG": strCorrectLocale = "0402"
	Case "ca-ES": strCorrectLocale = "0403"
	Case "zh-TW": strCorrectLocale = "0404"
	Case "cs-CZ": strCorrectLocale = "0405"
	Case "da-DK": strCorrectLocale = "0406"
	Case "de-DE": strCorrectLocale = "0407"
	Case "el-GR": strCorrectLocale = "0408"
	Case "en-US": strCorrectLocale = "0409"
	Case "es-ES_tradnl": strCorrectLocale = "040A"
	Case "fi-FI": strCorrectLocale = "040B"
	Case "fr-FR": strCorrectLocale = "040C"
	Case "he-IL": strCorrectLocale = "040D"
	Case "hu-HU": strCorrectLocale = "040E"
	Case "is-IS": strCorrectLocale = "040F"
	Case "it-IT": strCorrectLocale = "0410"
	Case "ja-JP": strCorrectLocale = "0411"
	Case "ko-KR": strCorrectLocale = "0412"
	Case "nl-NL": strCorrectLocale = "0413"
	Case "nb-NO": strCorrectLocale = "0414"
	Case "pl-PL": strCorrectLocale = "0415"
	Case "pt-BR": strCorrectLocale = "0416"
	Case "rm-CH": strCorrectLocale = "0417"
	Case "ro-RO": strCorrectLocale = "0418"
	Case "ru-RU": strCorrectLocale = "0419"
	Case "hr-HR": strCorrectLocale = "041A"
	Case "sk-SK": strCorrectLocale = "041B"
	Case "sq-AL": strCorrectLocale = "041C"
	Case "sv-SE": strCorrectLocale = "041D"
	Case "th-TH": strCorrectLocale = "041E"
	Case "tr-TR": strCorrectLocale = "041F"
	Case "ur-PK": strCorrectLocale = "0420"
	Case "id-ID": strCorrectLocale = "0421"
	Case "uk-UA": strCorrectLocale = "0422"
	Case "be-BY": strCorrectLocale = "0423"
	Case "sl-SI": strCorrectLocale = "0424"
	Case "et-EE": strCorrectLocale = "0425"
	Case "lv-LV": strCorrectLocale = "0426"
	Case "lt-LT": strCorrectLocale = "0427"
	Case "tg-Cyrl-TJ": strCorrectLocale = "0428"
	Case "fa-IR": strCorrectLocale = "0429"
	Case "vi-VN": strCorrectLocale = "042A"
	Case "hy-AM": strCorrectLocale = "042B"
	Case "az-Latn-AZ": strCorrectLocale = "042C"
	Case "eu-ES": strCorrectLocale = "042D"
	Case "wen-DE": strCorrectLocale = "042E"
	Case "mk-MK": strCorrectLocale = "042F"
	Case "st-ZA": strCorrectLocale = "0430"
	Case "ts-ZA": strCorrectLocale = "0431"
	Case "tn-ZA": strCorrectLocale = "0432"
	Case "ven-ZA": strCorrectLocale = "0433"
	Case "xh-ZA": strCorrectLocale = "0434"
	Case "zu-ZA": strCorrectLocale = "0435"
	Case "af-ZA": strCorrectLocale = "0436"
	Case "ka-GE": strCorrectLocale = "0437"
	Case "fo-FO": strCorrectLocale = "0438"
	Case "hi-IN": strCorrectLocale = "0439"
	Case "mt-MT": strCorrectLocale = "043A"
	Case "se-NO": strCorrectLocale = "043B"
	Case "ms-MY": strCorrectLocale = "043E"
	Case "kk-KZ": strCorrectLocale = "043F"
	Case "ky-KG": strCorrectLocale = "0440"
	Case "sw-KE": strCorrectLocale = "0441"
	Case "tk-TM": strCorrectLocale = "0442"
	Case "uz-Latn-UZ": strCorrectLocale = "0443"
	Case "tt-RU": strCorrectLocale = "0444"
	Case "bn-IN": strCorrectLocale = "0445"
	Case "pa-IN": strCorrectLocale = "0446"
	Case "gu-IN": strCorrectLocale = "0447"
	Case "or-IN": strCorrectLocale = "0448"
	Case "ta-IN": strCorrectLocale = "0449"
	Case "te-IN": strCorrectLocale = "044A"
	Case "kn-IN": strCorrectLocale = "044B"
	Case "ml-IN": strCorrectLocale = "044C"
	Case "as-IN": strCorrectLocale = "044D"
	Case "mr-IN": strCorrectLocale = "044E"
	Case "sa-IN": strCorrectLocale = "044F"
	Case "mn-MN": strCorrectLocale = "0450"
	Case "bo-CN": strCorrectLocale = "0451"
	Case "cy-GB": strCorrectLocale = "0452"
	Case "km-KH": strCorrectLocale = "0453"
	Case "lo-LA": strCorrectLocale = "0454"
	Case "my-MM": strCorrectLocale = "0455"
	Case "gl-ES": strCorrectLocale = "0456"
	Case "kok-IN": strCorrectLocale = "0457"
	Case "mni": strCorrectLocale = "0458"
	Case "sd-IN": strCorrectLocale = "0459"
	Case "syr-SY": strCorrectLocale = "045A"
	Case "si-LK": strCorrectLocale = "045B"
	Case "chr-US": strCorrectLocale = "045C"
	Case "iu-Cans-CA": strCorrectLocale = "045D"
	Case "am-ET": strCorrectLocale = "045E"
	Case "tmz": strCorrectLocale = "045F"
	Case "ne-NP": strCorrectLocale = "0461"
	Case "fy-NL": strCorrectLocale = "0462"
	Case "ps-AF": strCorrectLocale = "0463"
	Case "fil-PH": strCorrectLocale = "0464"
	Case "dv-MV": strCorrectLocale = "0465"
	Case "bin-NG": strCorrectLocale = "0466"
	Case "fuv-NG": strCorrectLocale = "0467"
	Case "ha-Latn-NG": strCorrectLocale = "0468"
	Case "ibb-NG": strCorrectLocale = "0469"
	Case "yo-NG": strCorrectLocale = "046A"
	Case "quz-BO": strCorrectLocale = "046B"
	Case "nso-ZA": strCorrectLocale = "046C"
	Case "ba-RU": strCorrectLocale = "046D"
	Case "lb-LU": strCorrectLocale = "046E"
	Case "kl-GL": strCorrectLocale = "046F"
	Case "ig-NG": strCorrectLocale = "0470"
	Case "kr-NG": strCorrectLocale = "0471"
	Case "gaz-ET": strCorrectLocale = "0472"
	Case "ti-ER": strCorrectLocale = "0473"
	Case "gn-PY": strCorrectLocale = "0474"
	Case "haw-US": strCorrectLocale = "0475"
	Case "so-SO": strCorrectLocale = "0477"
	Case "ii-CN": strCorrectLocale = "0478"
	Case "pap-AN": strCorrectLocale = "0479"
	Case "arn-CL": strCorrectLocale = "047A"
	Case "moh-CA": strCorrectLocale = "047C"
	Case "br-FR": strCorrectLocale = "047E"
	Case "ug-CN": strCorrectLocale = "0480"
	Case "mi-NZ": strCorrectLocale = "0481"
	Case "oc-FR": strCorrectLocale = "0482"
	Case "co-FR": strCorrectLocale = "0483"
	Case "gsw-FR": strCorrectLocale = "0484"
	Case "sah-RU": strCorrectLocale = "0485"
	Case "qut-GT": strCorrectLocale = "0486"
	Case "rw-RW": strCorrectLocale = "0487"
	Case "wo-SN": strCorrectLocale = "0488"
	Case "prs-AF": strCorrectLocale = "048C"
	Case "plt-MG": strCorrectLocale = "048D"
	Case "gd-GB": strCorrectLocale = "0491"
	Case "ar-IQ": strCorrectLocale = "0801"
	Case "zh-CN": strCorrectLocale = "0804"
	Case "de-CH": strCorrectLocale = "0807"
	Case "en-GB": strCorrectLocale = "0809"
	Case "es-MX": strCorrectLocale = "080A"
	Case "fr-BE": strCorrectLocale = "080C"
	Case "it-CH": strCorrectLocale = "0810"
	Case "nl-BE": strCorrectLocale = "0813"
	Case "nn-NO": strCorrectLocale = "0814"
	Case "pt-PT": strCorrectLocale = "0816"
	Case "ro-MO": strCorrectLocale = "0818"
	Case "ru-MO": strCorrectLocale = "0819"
	Case "sr-Latn-CS": strCorrectLocale = "081A"
	Case "sv-FI": strCorrectLocale = "081D"
	Case "ur-IN": strCorrectLocale = "0820"
	Case "az-Cyrl-AZ": strCorrectLocale = "082C"
	Case "dsb-DE": strCorrectLocale = "082E"
	Case "se-SE": strCorrectLocale = "083B"
	Case "ga-IE": strCorrectLocale = "083C"
	Case "ms-BN": strCorrectLocale = "083E"
	Case "uz-Cyrl-UZ": strCorrectLocale = "0843"
	Case "bn-BD": strCorrectLocale = "0845"
	Case "pa-PK": strCorrectLocale = "0846"
	Case "mn-Mong-CN": strCorrectLocale = "0850"
	Case "bo-BT": strCorrectLocale = "0851"
	Case "sd-PK": strCorrectLocale = "0859"
	Case "iu-Latn-CA": strCorrectLocale = "085D"
	Case "tzm-Latn-DZ": strCorrectLocale = "085F"
	Case "ne-IN": strCorrectLocale = "0861"
	Case "quz-EC": strCorrectLocale = "086B"
	Case "ti-ET": strCorrectLocale = "0873"
	Case "ar-EG": strCorrectLocale = "0C01"
	Case "zh-HK": strCorrectLocale = "0C04"
	Case "de-AT": strCorrectLocale = "0C07"
	Case "en-AU": strCorrectLocale = "0C09"
	Case "es-ES": strCorrectLocale = "0C0A"
	Case "fr-CA": strCorrectLocale = "0C0C"
	Case "sr-Cyrl-CS": strCorrectLocale = "0C1A"
	Case "se-FI": strCorrectLocale = "0C3B"
	Case "tmz-MA": strCorrectLocale = "0C5F"
	Case "quz-PE": strCorrectLocale = "0C6B"
	Case "ar-LY": strCorrectLocale = "1001"
	Case "zh-SG": strCorrectLocale = "1004"
	Case "de-LU": strCorrectLocale = "1007"
	Case "en-CA": strCorrectLocale = "1009"
	Case "es-GT": strCorrectLocale = "100A"
	Case "fr-CH": strCorrectLocale = "100C"
	Case "hr-BA": strCorrectLocale = "101A"
	Case "smj-NO": strCorrectLocale = "103B"
	Case "ar-DZ": strCorrectLocale = "1401"
	Case "zh-MO": strCorrectLocale = "1404"
	Case "de-LI": strCorrectLocale = "1407"
	Case "en-NZ": strCorrectLocale = "1409"
	Case "es-CR": strCorrectLocale = "140A"
	Case "fr-LU": strCorrectLocale = "140C"
	Case "bs-Latn-BA": strCorrectLocale = "141A"
	Case "smj-SE": strCorrectLocale = "143B"
	Case "ar-MA": strCorrectLocale = "1801"
	Case "en-IE": strCorrectLocale = "1809"
	Case "es-PA": strCorrectLocale = "180A"
	Case "fr-MC": strCorrectLocale = "180C"
	Case "sr-Latn-BA": strCorrectLocale = "181A"
	Case "sma-NO": strCorrectLocale = "183B"
	Case "ar-TN": strCorrectLocale = "1C01"
	Case "en-ZA": strCorrectLocale = "1C09"
	Case "es-DO": strCorrectLocale = "1C0A"
	Case "fr-West Indies": strCorrectLocale = "1C0C"
	Case "sr-Cyrl-BA": strCorrectLocale = "1C1A"
	Case "sma-SE": strCorrectLocale = "1C3B"
	Case "ar-OM": strCorrectLocale = "2001"
	Case "en-JM": strCorrectLocale = "2009"
	Case "es-VE": strCorrectLocale = "200A"
	Case "fr-RE": strCorrectLocale = "200C"
	Case "bs-Cyrl-BA": strCorrectLocale = "201A"
	Case "sms-FI": strCorrectLocale = "203B"
	Case "ar-YE": strCorrectLocale = "2401"
	Case "en-CB": strCorrectLocale = "2409"
	Case "es-CO": strCorrectLocale = "240A"
	Case "fr-CG": strCorrectLocale = "240C"
	Case "sr-Latn-RS": strCorrectLocale = "241a"
	Case "smn-FI": strCorrectLocale = "243B"
	Case "ar-SY": strCorrectLocale = "2801"
	Case "en-BZ": strCorrectLocale = "2809"
	Case "es-PE": strCorrectLocale = "280A"
	Case "fr-SN": strCorrectLocale = "280C"
	Case "sr-Cyrl-RS": strCorrectLocale = "281a"
	Case "ar-JO": strCorrectLocale = "2C01"
	Case "en-TT": strCorrectLocale = "2C09"
	Case "es-AR": strCorrectLocale = "2C0A"
	Case "fr-CM": strCorrectLocale = "2C0C"
	Case "sr-Latn-ME": strCorrectLocale = "2c1a"
	Case "ar-LB": strCorrectLocale = "3001"
	Case "en-ZW": strCorrectLocale = "3009"
	Case "es-EC": strCorrectLocale = "300A"
	Case "fr-CI": strCorrectLocale = "300C"
	Case "sr-Cyrl-ME": strCorrectLocale = "301a"
	Case "ar-KW": strCorrectLocale = "3401"
	Case "en-PH": strCorrectLocale = "3409"
	Case "es-CL": strCorrectLocale = "340A"
	Case "fr-ML": strCorrectLocale = "340C"
	Case "ar-AE": strCorrectLocale = "3801"
	Case "en-ID": strCorrectLocale = "3809"
	Case "es-UY": strCorrectLocale = "380A"
	Case "fr-MA": strCorrectLocale = "380C"
	Case "ar-BH": strCorrectLocale = "3C01"
	Case "en-HK": strCorrectLocale = "3C09"
	Case "es-PY": strCorrectLocale = "3c0a"
	Case "fr-HT": strCorrectLocale = "3C0C"
	Case "ar-QA": strCorrectLocale = "4001"
	Case "en-IN": strCorrectLocale = "4009"
	Case "es-BO": strCorrectLocale = "400A"
	Case "en-MY": strCorrectLocale = "4409"
	Case "es-SV": strCorrectLocale = "440A"
	Case "en-SG": strCorrectLocale = "4809"
	Case "es-HN": strCorrectLocale = "480A"
	Case "es-NI": strCorrectLocale = "4C0A"
	Case "es-PR": strCorrectLocale = "500A"
	Case "es-US": strCorrectLocale = "540A"
	Case "bs-Cyrl": strCorrectLocale = "641a"
	Case "bs-Latn": strCorrectLocale = "681a"
	Case "sr-Cyrl": strCorrectLocale = "6c1a"
	Case "sr-Latn": strCorrectLocale = "701a"
	Case "smn": strCorrectLocale = "703b"
	Case "az-Cyrl": strCorrectLocale = "742c"
	Case "sms": strCorrectLocale = "743b"
	Case "zh": strCorrectLocale = "7804"
	Case "nn": strCorrectLocale = "7814"
	Case "bs": strCorrectLocale = "781a"
	Case "az-Latn": strCorrectLocale = "782c"
	Case "sma": strCorrectLocale = "783b"
	Case "uz-Cyrl": strCorrectLocale = "7843"
	Case "mn-Cyrl": strCorrectLocale = "7850"
	Case "iu-Cans": strCorrectLocale = "785d"
	Case "nb": strCorrectLocale = "7c14"
	Case "sr": strCorrectLocale = "7c1a"
	Case "tg-Cyrl": strCorrectLocale = "7c28"
	Case "dsb": strCorrectLocale = "7c2e"
	Case "smj": strCorrectLocale = "7c3b"
	Case "uz-Latn": strCorrectLocale = "7c43"
	Case "mn-Mong": strCorrectLocale = "7c50"
	Case "iu-Latn": strCorrectLocale = "7c5d"
	Case "tzm-Latn": strCorrectLocale = "7c5f"
	Case "ha-Latn": strCorrectLocale = "7c68"
	Case Else
		LogThis "No match for LocaleName!"
		cleanExit
End Select

'Quick convert to correct the number of characters
strCorrectLocale = Right(String(8,"0") & UCase(strCorrectLocale), 8 )

LogThis "CorrectLocale for " & strLocaleName &": " & strCorrectLocale
If strLocale = strCorrectLocale Then
	LogThis "Locales match. Nothing to do"
Else
	LogThis "Locales do not match. Editing hive!"
	objShell.RegWrite strTempReg & "\Control Panel\International\Locale", strCorrectLocale, "REG_SZ"
End If
cleanExit

Sub LogThis(strText)
	WScript.Echo strText
End Sub

Sub cleanExit
	LogThis "Unloading hive and exiting"
	objShell.Run("Reg.exe unload " & strTempReg), 0, True
	WScript.Quit 0
End Sub
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.