If you want to change keyboard layout in Windows, use can use WinAPI function ActivateKeyboardLayout. Because it’s not supported directly in AX, you have to implement it in WinAPI class by yourself (or you could encapsulate it in a .NET library with the help of pinvoke).
can you please help me to elaborate it through code. because I tried it but not able to get the keyboard language and also not able to change keyboard language through code.
I successfully tested the code in Windows7 / AX2009. It works without any issue for me, the only prerequisite is to have the languages installed so you can switch between them manually. Installation of additional language is not in scope of the script.
I can’t know what exactly is the wrong in your environment - that’s up to you to debug it. If you provided more details about your configuration, it would be possible at least to test it whether it’s not an OS-related issue or so.