I want to auto login to websites from a batch file.
However, for certain websites, %SendKeys% "{ENTER}"
, for clicking the login button, does not work. In fact while doing manually, I couldn't find any keyboard button combination that let me press the login button. The only option was to left click on it with the mouse.
Is it possible to write a code for accessing that button and clicking on it using its class name which I can get from "inspect element"?
The batch file that I used is this:
@if (@CodeSection == @Batch) @then
@echo off
set SendKeys=CScript //nologo //E:JScript "%~F0"
set url = "address of the website"
start CHROME "" %url%
%SendKeys% "my username"
%SendKeys% "{TAB}"
%SendKeys% "my password"
%SendKeys% "{ENTER}"
pause
goto :EOF
@end
// JScript section
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SendKeys(WScript.Arguments(0))
I guess you can try it by sending the
Tab
button and then sending theEnter
key after it