English 中文(简体)
• 如何创建批量文档,开放网站,如电子邮件.com,进入用户名称和密码
原标题:How to create batch file which opens an website e.g. gmail.com and enters user name and password
  • 时间:2011-10-01 07:47:33
  •  标签:
  • batch-file

i need to create a batch file which opens a website(gmail) and enters username and password. so can anyone help me please.. Thank you.

这里是所尝试的法典。 它打开电子邮件,现在如何进入用户名和密码。

作为试验节省下来。

@echo off
start /d "C:Program FilesInternet Explorer" IEXPLORE.EXE https://gmail.com
问题回答

让我评论,但我同意,这样做是错误的。 不过,你可以这样作。

add-type -AssemblyName microsoft.VisualBasic
add-type -AssemblyName System.Windows.Forms
#Loads Website
C:Progra~1Intern~1iexplore.exe -k http://www.gmail.com
#Enter Credentials
[System.Windows.Forms.SendKeys]::SendWait("userid{TAB}password{enter}")

我们不能这样做。 你们可以打开一条特别的圆顶,但你不能以某种形式进入价值观。

您可以迅速从指挥部门开一个电子邮件地址,但这将打开不实的电子邮件客户,而不是一些电子邮件网页。 不幸的是,这是不可能的。

我认为,实现你目标的方法完全是分不开的。

您可尝试用撰写一些文章。 但是,每当页有新的具体内容时,你们都需要修改你的法典。

可以用 Sel进行。 你们需要撰写一份简明的《Juanni》测试。 当然,这要求在电脑上安装 Java。 这将是大约20-30条法典。 之后,你可以按批号进行Junnit测试:

@ECHO off
SET username=me
SET password=mypassword
java -cp MyGmailTest.class MyGmailTest %username% %password%
timeout 10

使用 se灭火的 se光网络驱动器。

http://docs.seleniumhq.org/download/

进口所有必要的网络司机图书馆,非常简单。 与此类似:

public class checkEmail{

public static void main(String args[]){
WebDriver driver = new FirefoxDriver();
driver.get("www.gmail.com");
driver.findElement(By.id("Email")).sendKeys("your usernamne");
driver.findElement(By.id("Passwd")).sendKeys("your password");
driver.findElement(By.id("signIn")).click();

iii

iii

get the .class files, then make a simple batch file @ECHO OFF set CLASSPATH= (wherever your selenium jars are) cd C:where ever the class file is java checkEmail

缩略语

@echo off

set command=C:Users\%USERNAME%DesktopGMAIL.VBS

start https://gmail.com

echo Set objShell = WScript.CreateObject("WScript.Shell") > %command%

echo Set WshShell = WScript.CreateObject("WScript.Shell") >> %command%

echo Do Until Success = True >> %command%

echo     Success = objShell.AppActivate("Mozilla Firefox") >> %command%

echo Loop >> %command%

echo WshShell.SendKeys "USERNAME HERE" >> %command%

echo WshShell.SendKeys "{TAB}" >> %command%

echo WshShell.SendKeys "[PASSWORD HERE] >> %command%

echo WshShell.SendKeys "{ENTER}" >> %command%

ping 192.0.2.2 -n 1 -w 5000 > nul

start %command%

ping 192.0.2.2 -n 1 -w 1000 > nul

del %command%

exit

chance [USERNAME HERE] AND [PASSWORD] { with the [ ] }

目 录

@echo off

set command=C:Users\%USERNAME%DesktopGMAIL.VBS

start https://gmail.com

echo Set objShell = WScript.CreateObject("WScript.Shell") > %command%

echo Set WshShell = WScript.CreateObject("WScript.Shell") >> %command%

echo Do Until Success = True >> %command%

echo     Success = objShell.AppActivate("Google Chrome") >> %command%

echo Loop >> %command%

echo WshShell.SendKeys "USERNAME HERE" >> %command%

echo WshShell.SendKeys "{TAB}" >> %command%

echo WshShell.SendKeys "[PASSWORD HERE] >> %command%

echo WshShell.SendKeys "{ENTER}" >> %command%

ping 192.0.2.2 -n 1 -w 5000 > nul

start %command%

ping 192.0.2.2 -n 1 -w 1000 > nul

del %command%

exit

chance [USERNAME HERE] AND [PASSWORD] { with the [ ] } 
@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));
While i myself am still experimenting and testing this batch file program on different applications, i am not sure as to the inner-workings of what this program actually does. All i know is it uses a java script installed on every windows computer to push keyboard commands to be executed. However in my experimentation i found that it could also serve as a means to fill in passwords and usernames.

@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% "username{TAB}"
%SendKeys% "password{ENTER}"

goto :EOF


@end
// JScript section

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

检查





相关问题
complex batch replacement linux

I m trying to do some batch replacement for/with a fairly complex pattern So far I find the pattern as: find ( -name *.php -o -name *.html ) -exec grep -i -n hello {} + The string I want ...

How to split a string by spaces in a Windows batch file?

Suppose I have a string "AAA BBB CCC DDD EEE FFF". How can I split the string and retrieve the nth substring, in a batch file? The equivalent in C# would be "AAA BBB CCC DDD EEE FFF".Split()[n]

How to check which Operating System?

How can I check OS version in a batch file or through a vbs in an Windows 2k/2k3 environment ? You know ... Something like ... : "If winver Win2k then ... or if winver Win2k3 then ....

热门标签