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:
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?
Answer
I was able to come up with a solution to my problem!
There are a few things I learned.
In the "ID", the portion of the number in front of the colon ("1009") represents the Region Keyboard ie English(Canada). The number after the colon ("00001009") is the actual language installed for that keyboard. "00001009" will actually target the "Canada French" under the Region keyboard of English(Canada)
Another thing that I learned is that the region codes on the MS site were not displayed properly, which is why I wasn't able to change the "Locale" properly. This link contains the values you need to use when changing the "Locale". US is GeoID=244
The other thing I ended up having to do was to create two different XML files and run them one after the other. For some reason, removing the English(Canada) keyboard and all of it's sublanguages then adding the English(US) keyboard in the same script was producing an error that was stopping the XML file from applying properly. I had to do the removal of the keyboards (I left the Format and Locale change) in one XML file and the adding of the US keyboard in another XML file.
Anyway, for anyone interested I will post my final XML files below. To run them I used the following commands in a batch file.
control intl.cpl,, /f:"
"
(there is a space after the second comma)
First script to remove keyboards, change Format, and change Locale
Pay special attention to how the "ID" values are done, it illustrates what I was trying to explain above!
This script will add in the US keyboard and set it as the system default keyboard
That about sums it up.
Here are some additional helpful links:
http://msdn.microsoft.com/en-us/library/ms912389%28WinEmbedded.11%29.aspx
http://texhex.blogspot.com/2009/10/installing-and-configuring-language.html
http://msdn.microsoft.com/en-us/goglobal/bb896001
http://technet.microsoft.com/en-us/library/cc766503(WS.10).aspx
Comments
Post a Comment