Discussion Locked

VBScript to invoke URL?

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello,

I searched the forums for a possible solution but didn't find one. I am trying to figure out if there is a way to use a vbscript to open a URL link on a server. The purpose of this would be to register the server with another server starting a new session. Basically, I just want to call a URL from a vbscript that will run automatically when a server recovers from a failure. I am new to vbscripting so I hope I have explained this well enough!
Thanks in advance for any help.
Sean

2 replies

by tjackson

This is how I did it:

Call ViewHtml( "https://www.techrepublic.com.com", False )
' ******************************************************************************
' ******************************************************************************
Sub ViewHtml( ByVal sFile, ByVal bWait )
Dim oWsh
Const sgExeFile = "C:\Program Files\Internet Explorer\IEXPLORE.EXE"
Const sWINDOWSTYLE = 3

If bWait = Empty Then
bWait = False
End If

Set oWsh = WScript.CreateObject("WScript.Shell")
oWsh.Run CHR(34) & sgExeFile & CHR(34) & " " & sFile, sWINDOWSTYLE, bWait

Set oWsh = Nothing
End Sub
' ******************************************************************************
' ******************************************************************************

by tmastana

Dim wShell
Set wShell = CreateObject("WScript.Shell")
wShell.Run "this will be your url",9

This discussion is closed to new replies.