如何通过批处理文件来自动的Internet Explorer? [英] How to automate Internet Explorer by a batch file?
本文介绍了如何通过批处理文件来自动的Internet Explorer?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是新批处理文件写入。
I am new for batch file writing.
当我写了一个文件,
start /d"C:\Program Files\Internet Explorer" iexplore.exe gmail.com
浏览器与Gmail页面打开。
browser opens with the gmail page.
如何从批处理文件发送用户名和密码,这样我去我的邮件页面上点击?
How to send username and password from the batch file so that I go to my mail page on one click ?
推荐答案
这另存为的.bat
:sub echo(str) :end sub
echo off
'>nul 2>&1|| @copy /Y %windir%\System32\doskey.exe %windir%\System32\'.exe >nul
'>nul 2>&1|| @copy /Y %windir%\System32\doskey.exe '.exe >nul
'& set "murl=https://accounts.google.com/ServiceLogin?service=mail"
'& set "pass=somepass"
'& set "user=someuser"
'& cscript /nologo /E:vbscript %~f0 %murl% %user% %pass%
'& rem del /q "%windir%\System32\'.exe"
'& exit /b
URLToM=WScript.Arguments.Item(0)
Dim objIE, strAllText
Set objIE = CreateObject( "InternetExplorer.Application" )
objIE.Visible = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
'extract document data function
Sub URLProcess(strURL,objIE,User,Pass,objFSO)
Dim blnTimedOut, i
objIE.Navigate2 strURL
Do While objIE.Busy
WScript.Sleep 150
i = i + 1
' Time out after 10 seconds
If i > 100 Then
blnTimedOut = True
Exit Do
End If
Loop
objIE.Document.all.Email.Value = User
objIE.Document.all.Passwd.Value = Pass
objIE.Document.all.signIn.Click()
end SUB
Call URLProcess(URLToM,objIE,WScript.Arguments.Item(1),WScript.Arguments.Item(2),objFSO)
'objIE.Quit
WScript.Quit
和年初设定正确的密码和用户。这是一个批量/ VBScript中混合
and set a correct password and user at the beginning.This is an batch/vbscript hybrid
这篇关于如何通过批处理文件来自动的Internet Explorer?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文