Windows 7 - Change Region and Language settings using a script

Date Published: 11/03/2011 10:20 PM
Author: bourne

OS: Windows 7 64-bit

I have a machine that has had its "Region and Language" settings all set to "Canada". What I need to do is change all those settings to revert back to the default of "United States". Additionally, I want to create a script to do this, as I expect to run into more machines with this issue. I don't want to have to change settings through the GUI on every machine.

I need to do these actions on these tabs:

Region and Language (Format)-
I need "Format" changed to "English (United States)"

Region and Language (Location)-
I need "Current Location" set to "United States"

Region and Language - Text Services and Input Language (General)-
I need to delete all keyboard languages except for "English (United States) - US"

Region and Language (Administrative)-
Here I believe that "non-Unicode programs" will also have to be set to "English (United States)"

(I have screenshots but I do not have the reputation required to post them.)

So far I have found this document from Microsoft that demonstrates an XML file that can be created to modify the settings above

The problem is that the only XML example from the link that appears to be working properly is the one for adding and setting a keyboard language as default. I have tried some of the other examples but they do not appear to be working. Here's a working example:

<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">
<!--User List-->
<gs:UserList>
<gs:User UserID="Current"/>
</gs:UserList>
<!--input preferences-->
<gs:InputPreferences>
<!--en-US-->
<gs:InputLanguageID Action="add" ID="0409:00000409" Default="true"/>
<!--en-CANADA-->
<gs:InputLanguageID Action="remove" ID="1009:00001009"/>
</gs:InputPreferences>
</gs:GlobalizationServices>

The code above will add in the United States keyboard language if it doesn't exist and then set it as default, but unfortunately I can't get it to delete the Canadian keyboard language.

Is there a method to programatically change all these settings? Am I overlooking something obvious?

View full answer on SuperUser

View Local Answers...

Can't find the answer to this question?

No answers yet.

Can you answer this question?

Windows 7 - Change Region and Language settings using a script

  • Your Nickname
  • Your Answer

  • Enter the code below to prove you are human