1 Open your favorite text editor. In our case we are going to use Notepad++
2 Copy the VBScript code from below.
3 Paste the code in the newly created file.
4 Save the file with a ".vbs" extension.
5 Run the script file by double-clicking on it or via the CMD console.
6 That's it!
Advertisement
Code
' This script creates an MS Internet Explorer instance and navigates to a webpage.
Sub createAnInternetExplorerInstance()
' Set variables
Dim appInternetExplorer
Dim strLinkToWebpage
' Create new internet explorer application object
Set appInternetExplorer = Wscript.CreateObject("InternetExplorer.Application")
' Set webpage link
strLinkToWebpage = "https://www.msn.com/"
' Use the newly created internet explorer instance
With appInternetExplorer
' Set window width
.Width = 1000
' Set window height
.Height = 500
' Set window top position
.Top = 0
' Set window left position
.Left = 0
' Set visibility state
.Visible = True
' Navigate to webpage
.Navigate strLinkToWebpage
End With
' Release the internet explorer application object
Set appInternetExplorer = Nothing
End Sub
' Run the procedure
Call createAnInternetExplorerInstance()