vbs如何打开ie

这篇文章主要为大家展示了“vbs如何打开ie”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“vbs如何打开ie”这篇文章吧。

第一种方法 InternetExplorer.Application

StartURL = "www.jb51.net" 
set IE = CreateObject("InternetExplorer.Application") 
IE.Visible = true 
IE.Navigate StartURL

第二种方法 WScript.Shell

dim Wsh 
Set Wsh=WScript.CreateObject("WScript.Shell") 
On error Resume Next 
objeShell.Run("http://www.baidu.com")

下面的代码就是自动打开百度并输入亿速云进行搜索的代码

Dim wsh,ie 
Set wsh = CreateObject("wscript.shell") 
Set ie = WScript.CreateObject("InternetExplorer.Application") 
URL="http://www.baidu.com" 
code="亿速云" 
ie.visible = True 
ie.navigate URL 
WScript.Sleep 1000 
wsh.AppActivate "百度一下,你就知道 " ' 引号中填浏览器最上面的标题 
wsh.Run "cmd.exe /c echo " & code & "| clip.exe", vbHide 
wsh.SendKeys "^v" 
wsh.SendKeys "{ENTER}"

 用vbs实现网站自动登录

Dim wsh,ie 
Set wsh = CreateObject("wscript.shell") 
Set ie = WScript.CreateObject("InternetExplorer.Application") 
URL=" http://www.baidu.com" 
ie.visible = True 
ie.navigate URL 
WScript.Sleep 1000*5 
wsh.AppActivate " " ' 引号中填浏览器最上面的标题 
WScript.Sleep 1000*1 
wsh.SendKeys "帐号" '引号中填帐号 
WScript.Sleep 1000*1 
wsh.SendKeys "{TAB}" 
WScript.Sleep 1000*1 
wsh.SendKeys "密码" '引号中填密码 
WScript.Sleep 1000*1 
wsh.SendKeys "{ENTER}"

以上是“vbs如何打开ie”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注行业资讯频道!