Two Methods of enabling ie in vbs: start ie browser implementation code in VBScript

Source: Internet
Author: User

Method 1: InternetExplorer. Application

Copy codeThe Code is as follows: StartURL = "www.jb51.net"
Set IE = CreateObject ("InternetExplorer. Application ")
IE. Visible = true
IE. Navigate StartURL

Method 2 WScript. Shell
Copy codeThe Code is as follows: dim Wsh
Set Wsh = WScript. CreateObject ("WScript. Shell ")
On error Resume Next
Wsh. Run "www.jb51.net"

The following code automatically opens Baidu and enters the script home for searchCopy codeThe Code is as follows: Dim wsh, ie
Set wsh = CreateObject ("wscript. shell ")
Set ie = WScript. CreateObject ("InternetExplorer. Application ")
URL = "http://www.baidu.com"
Code = "script home"
Ie. visible = True
Ie. navigate URL
WScript. Sleep 1000
Wsh. AppActivate "Baidu, 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 }"

Copy codeThe Code is as follows: 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 "'
WScript. Sleep 1000*1
Wsh. SendKeys "{TAB }"
WScript. Sleep 1000*1
Wsh. SendKeys "password" 'enter the password in quotation marks
WScript. Sleep 1000*1
Wsh. SendKeys "{ENTER }"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.