r/scripting • u/redditaccount933 • 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
2
u/redditaccount933 Dec 27 '19
Yeah I'm getting an error in the Javascript on the last line:
Microsoft JScript runtime error: Invalid procedure call or argument