Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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