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?

link|improve this question

72% accept rate
feedback

1 Answer

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.