非英文键盘的发送键故障

Send keys malfunctions for non English keyboards

我有以下访问特定站点并输入用户名的代码(从 %USERNAME% 中获取)。

只要键盘设置为英语,它就可以正常工作,但是,如果键盘设置为另一种语言,它就无法正常工作。

有没有什么方法可以从批处理文件更改键盘输入语言或用其他方法解决这个问题?

@if (@CodeSection == @Batch) @then


@echo off

rem Use %SendKeys% to send keys to the keyboard buffer
set SendKeys=CScript //nologo //E:JScript "%~F0"
start chrome -new-window --incognito "https://servicedesk.sa.gov.ge/"
rem the script only works if the application in question is the active window. Set a timer to wait for it to load!
timeout /t 3
rem use the tab key to move the cursor to the login and password inputs. Most htmls interact nicely with the tab key being pressed to access quick links.

rem now you can have it send the actual username/password to input box
%SendKeys% "%USERNAME%"
%SendKeys% "{TAB}"

goto :EOF


@end
// JScript section

var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SendKeys(WScript.Arguments(0));

暂时Windows不支持此功能,我也尝试在超级用户上找到答案,但目前还没有解决方案。