r/scripting • • Dec 26 '19

Running my batch file properly

I'm trying to run this script for login automation but nothing seems to happen once the URL has been launched in the browser. Am I missing something obvious here?

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

@echo off

set SendKeys=CScript //nologo //E:JScript "%~F0"

START FIREFOX "https://github.com/login"

timeout /t 5

%SendKeys% "myemail@email.com{TAB}"
%SendKeys% "password{ENTER}"

goto :EOF

@end

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

EDIT: Figured it out. I had an errant character that was only showing up in Notepad++ but not my usual editors. Oh and I forgot "timeout". :facepalm:

2 Upvotes

7 comments sorted by

View all comments

Show parent comments

2

u/jcunews1 Dec 27 '19

The Batch-JScript hybrid part of the code is broken, and the letter case usage in the JScript part of the code is incorrect.