Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have multiple input languages in my Windows XP: English and Hebrew. I use both of them.

I want to make a script that will programmatically switch to English. (If that's hard to do, a workaround might be to programatically press Alt-Shift, if that's possible.)

Does anyone know how to do that?

share|improve this question
up vote 1 down vote accepted

I wasn't able to find any correct programmatic way of doing this, but it's pretty easy to fake out pressing a key. Here is a PowerShell script that does that:

[System.Reflection.Assembly]::Load("System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
[System.Windows.Forms.SendKeys]::SendWait("%+")

EDIT:

I found out a better way to do this programmatically, essentially using the LoadKeyboardLayout and ActivateKeyboardLayout functions. I'll admit, it isn't very easy to script.

share|improve this answer

You must log in to answer this question.

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