第一種方法 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")
下面的代碼就是自動(dòng)打開百度并輸入腳本之家進(jìn)行搜索的代碼
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 "百度一下,你就知道 " ' 引號(hào)中填瀏覽器最上面的標(biāo)題
wsh.Run "cmd.exe /c echo " code "| clip.exe", vbHide
wsh.SendKeys "^v"
wsh.SendKeys "{ENTER}"
用vbs實(shí)現(xiàn)網(wǎng)站自動(dòng)登錄
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 " " ' 引號(hào)中填瀏覽器最上面的標(biāo)題
WScript.Sleep 1000*1
wsh.SendKeys "帳號(hào)" '引號(hào)中填帳號(hào)
WScript.Sleep 1000*1
wsh.SendKeys "{TAB}"
WScript.Sleep 1000*1
wsh.SendKeys "密碼" '引號(hào)中填密碼
WScript.Sleep 1000*1
wsh.SendKeys "{ENTER}"
好了,內(nèi)容就介紹到這,希望大家以后多多支持腳本之家。