BATCH SCRIPT – Automating website login

Question:

I have the objective of creating a .bat file that automates my login to a certain site.

I can open the site with .bat through the command start chrome.exe "mysite.com", and I would like to know how to create a script that presses the TAB key twice and the ENTER key once.

Example of what I imagine it to be:

start chrome.exe "http://www.meusite.com"
teclado_automatico "{Alt}"
teclado_automatico "{Alt}"
teclado_automatico "{Enter}"

Answer:

An example in VBS, with internet explorer that you can adapt:

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.AppActivate "Internet Explorer"
Wscript.Sleep 1500
WshShell.SendKeys "{TAB}"
Wscript.Sleep 1500
WshShell.SendKeys "{TAB}"
Wscript.Sleep 1500
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 1500
Scroll to Top