Is is possible to change the keyboard layout via command line on Windows XP/7?
No (not via CMD), you will have to change it the following way. There used to be a
Windows 7 or Windows Vista
But you can in Linux using
command line example:
Windows 8 brings a new International PowerShell module. Unfortunately it doesn't seem like this can be backported or has any Windows 7 alternative
Configure international settings by using PowerShell cmdlets