Dim a
Set a=WScript.CreateObject("WScript.shell")
a.run "http:\\www.baidu.com" '登陆界面的地址
WScript.Sleep 3000 '暂停3秒,因为打开网页需要一段时间
a.SendKeys "{TAB}"
a.SendKeys "{TAB}" '按几下TAB使输入框获得焦点就写几个WshShell.SendKeys "{TAB}"
a.SendKeys "abc" '帐号
a.SendKeys "{TAB}"
a.SendKeys "123456" '密码
a.SendKeys "{TAB}"
a.SendKeys "{ENTER}" '一些网站登陆有点区别,你要按什么键自己加上去就好了
保存为.vbs文件
@echo off
rem 假设要打开的网页就是百度登录页面.
< "%~f0" more +6 > l.vbs
cscript //nologo l.vbs
del l.vbs
goto :eof
set s=createobject("wscript.shell")
s.run "cmd /c start iexplore http://passport.baidu.com/?login",vbhide
rem 在上一句中可自行修改要打开的网页!
wscript.Sleep 3000
s.SendKeys "admin"
s.SendKeys "{TAB}"
s.SendKeys "admin"
s.SendKeys "{TAB}"
s.SendKeys "{ENTER}"
Dim a
Set a=WScript.CreateObject("WScript.shell")
a.run "http:\\www.baidu.com"
WScript.Sleep 3000
a.SendKeys "{TAB}"
a.SendKeys "{TAB}"
WshShell.SendKeys
a.SendKeys "admin"
a.SendKeys "{TAB}"
a.SendKeys "admin"
a.SendKeys "{TAB}"
a.SendKeys "{ENTER}"
DIM objShell
set objShell=wscript.createObject("wscript.shell")
iReturn=objShell.Run("cmd.exe /C d:\1.bat", 0, TRUE)
保存为1.vbs
再将
@echo off
set ie="C:\Program Files\Internet Explorer\IEXPLORE.EXE"
%ie% %1(把楼上的这里改一下)
exit
保存为2.bat
以后在运行输入2.bat 你要打开的网站回车
就可以拉
DIM objShell
set objShell=wscript.createObject("wscript.shell")
iReturn=objShell.Run("cmd.exe /C d:\1.bat", 0, TRUE)
保存为1.vbs
再将
@echo off
set ie="C:\Program Files\Internet Explorer\IEXPLORE.EXE"
%ie% 你要打开的网站
exit