Automatically open a browser and login to a site?

前端 未结 2 1356
不思量自难忘°
不思量自难忘° 2020-12-09 12:26

I have a 70 years old grandma that is not used to use the computer, but she has an e-mail and Facebook, and every time she wants to access those sites i have to help her thr

2条回答
  •  悲哀的现实
    2020-12-09 13:03

    This worked for me actually, I referred jouster500 answer, there were few bugs which I rectified, works like a charm.

    @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 "https://login.classy.org/"
    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 10
    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 %SendKeys% "{TAB}"
    rem now you can have it send the actual username/password to input box
    %SendKeys% "{TAB}"
    %SendKeys% "{TAB}"
    %SendKeys% "username"
    %SendKeys% "{TAB}"
    %SendKeys% "password"
    %SendKeys% "{ENTER}"
    
    goto :EOF
    
    @end
    // JScript section
    
    var WshShell = WScript.CreateObject("WScript.Shell");
    WshShell.SendKeys(WScript.Arguments(0));
    

提交回复
热议问题