第一种方法 InternetExplorer.Application
StartURL = "www.jb51.net"
set IE = CreateObject("InternetExplorer.Application")
IE.Visible = true
IE.Navigate StartURL
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
Wsh.Run "www.jb51.net"
Set Wsh=WScript.CreateObject("WScript.Shell")
On error Resume Next
Wsh.Run "www.jb51.net"
下面的代码就是自动打开百度并输入脚本之家进行搜索的代码
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}"
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}"