capito questo oggi, come si può usare i file batch sui computer Windows per spingere i comandi da tastiera per siti web o altre applicazioni, se necessario. Vedere here per le informazioni di codifica originali.
Il nucleo del comando che troverete qui si traduce semplicemente come
@if (@CodeSection == @Batch) @then
@echo off
rem Use %SendKeys% to send keys to the keyboard buffer
set SendKeys=CScript //nologo //E:JScript "%~F0"
%SendKeys% "{ENTER}"
goto :EOF
@end
// JScript section
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SendKeys(WScript.Arguments(0));
mentre io sto ancora sperimentando e testando questo programma file batch su diverse applicazioni, non sono sicuro da funzionamento interno di ciò che effettivamente fa questo programma. Tutto quello che so è che utilizza uno script java installato su ogni computer Windows per spingere i comandi da tastiera per essere eseguiti. Tuttavia nella mia sperimentazione ho scoperto che potrebbe anche servire come mezzo per inserire password e nomi utente.
@if (@CodeSection == @Batch) @then
@echo off
rem Use %SendKeys% to send keys to the keyboard buffer
set SendKeys=CScript //nologo //E:JScript "%~F0"
START FIREFOX "WWW.EXAMPLE.COM"
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 5
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.
%SendKeys% "{TAB}"
rem now you can have it send the actual username/password to input box
%SendKeys% "{U}"
%SendKeys% "{s}"
%SendKeys% "{E}"
%SendKeys% "{r}"
%SendKeys% "{N}"
%SendKeys% "{a}"
%SendKeys% "{M}"
%SendKeys% "{e}"
%SendKeys% "{TAB}"
%SendKeys% "{P}"
%SendKeys% "{4}"
%SendKeys% "{S}"
%SendKeys% "{S}"
%SendKeys% "{W}"
%SendKeys% "{O}"
%SendKeys% "{R}"
%SendKeys% "{D}"
%SendKeys% "{ENTER}"
goto :EOF
@end
// JScript section
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SendKeys(WScript.Arguments(0));
Collegando così tua nonna al sito web specifico. Sebbene si tratti di una approssimativa approssimazione del codice che avrei tentato di eseguire, dovrebbe comunque funzionare. In caso contrario, iniziare da zero con il link fornito. Inoltre, se hai bisogno di modi per includere quei caratteri speciali, controlla anche here.
* EDIT:
In seguito ho fatto qualcosa di simile per me e hanno trovato un modo più semplice, invece di digitare tutti coloro% SendKeys%. Puoi semplicemente fare
%SendKey% "Username{TAB}"
%SendKey% "Password{ENTER}"
come un modo più semplice di passare attraverso il processo di login. L'unico lato negativo di tutto questo è che se decide di cambiare il suo login, dovresti cambiare la sua password all'interno del programma.
Non è necessario. Basta impostare la home page, quindi metterla in avvio. – SLaks
possibile duplicato di [Accesso automatico a un sito Web su Windows 7/Chrome tramite file batch] (http://stackoverflow.com/questions/14204623/automatic-login-to-a-website-on-windows-7-chrome- via-batch-file) – SomethingDark
So che ci sono altri modi in cui l'uomo, ma voglio fare un programma, sarebbe più facile per lei. E, a volte l'e-mail di mia madre è loggato e devo disconnettermi per connetterti con lei. È complesso per lei, voglio solo fare un programma "Enter my email" in modo che non debba preoccuparsi di queste situazioni. –