Two methods of opening ie in VBS implementation code of starting IE browser in VBScript

Time:2022-5-3

The first method is Internet Explorer Application

?
1
2
3
4
StartURL = "www.zzvips.com"
set IE = CreateObject("InternetExplorer.Application")
IE.Visible = true
IE.Navigate StartURL

The second method is Wscript Shell

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

The following code is the code that automatically opens Baidu and enters developeppaper for search

?
1
2
3
4
5
6
7
8
9
10
11
12
Dim wsh,ie
Set wsh = CreateObject("wscript.shell")
Set ie = WScript.CreateObject("InternetExplorer.Application")
URL="http://www.baidu.com"
code="developpaper"
ie.visible = True
ie.navigate URL
WScript.Sleep 1000
wsh.AppActivate "Baidu once, you will know" 'fill in the top title of the browser in quotation marks
wsh.Run "cmd.exe /c echo " & code & "| clip.exe", vbHide
wsh.SendKeys "^v"
wsh.SendKeys "{ENTER}"

Automatic login of website with vbs

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 " " 'fill in the top title of the browser in quotation marks
WScript.Sleep 1000*1
wsh.SendKeys "Account number" 'fill in quotation marks
WScript.Sleep 1000*1
wsh.SendKeys "{TAB}"
WScript.Sleep 1000*1
wsh.SendKeys "Password" 'password in quotation marks
WScript.Sleep 1000*1
wsh.SendKeys "{ENTER}"

OK, that’s all for the content. I hope you can support developepper in the future.