Jump to content
Sign in to follow this  
BigDaddyO

How to Set Country Code and Locale

Recommended Posts

BigDaddyO

I am working on customizing an installer for some French Canadian PC's, but the application requires their Country Code to be 1 and the Locale to be 0409. also known as Anglais (Canada)

I have a script that can read their current settings but can't figure out how to change those settings.

$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem")
For $objItem In $colItems
  $sReturn = "Country Code: " & $objItem.CountryCode
  $sReturn &= @CRLF & "Locale: " & $objItem.Locale
  $sReturn &= @CRLF & "OS Language: " & $objItem.OSLanguage
  $sReturn &= @CRLF & "Code Set: " & $objItem.CodeSet
  FileWrite(@DesktopDir & "\Locale.txt", $sReturn)
Next

French Canadian pc's return this

Country Code: 2

Locale: 0c0c

OS Language: 1036

Code Set: 1252

I need to change the settings to Anglais (Canada)

Country Code: 1

Locale: 0409

OS Language: 1036

Code Set: 1252

Anyone have some ideas? Google and Bing searches are not giving me much to go on.

Thanks,

Mike


hmm... I guess I have to have a signature...

Share this post


Link to post
Share on other sites
PsaltyDS

Those properties of the Win32_OperatingSystem object are read-only.

Did you try it from the registry settings at "HKCU\Control Panel\International"?

:blink:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×