Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to open new tab 1

Status
Not open for further replies.

Enkrypted

Technical User
Sep 18, 2002
663
US
I'm not sure if this is a simple solution or not, but I have some code that will open a webpage, but I'm having trouble finding a way to get a new URL to open on a new tab within the same window. Can anyone assist with this?

Enkrypted
A+
 
Code:
Set WshShell = WScript.CreateObject("WScript.Shell") 
Return = WshShell.Run("iexplore.exe [URL unfurl="true"]https://website.com/",[/URL] 1)

I would like to get a new tab opened up as well with a different URL.

Enkrypted
A+
 
Hi [peace]
You can try this code that show you how to run Firefox in command line with arguments like New Tab or New Window

Code:
Option Explicit
Dim Titre,Ws,Question1,Question2,NewOnglet,Largeur,NewFenetre,URL 
Titre = "Options pour Ouvrir FireFox en ligne de Commande"
Set Ws = CreateObject("Wscript.shell")
'Les Arguments en ligne de commande
NewOnglet = "-new-tab"
NewFenetre = "-new-window"
URL = "[URL unfurl="true"]http://bbat.forumeiro.com"[/URL]
Question1 = MsgBox ("Voulez-vous accéder au site "&qq(URL)&vbcr&" dans un nouvel Onglet ? ",VBYesNO+VbQuestion,Titre)
If Question1 = VbYes then
	NouvelOnglet()
else
	Wscript.Quit
end if
wscript.sleep 10000
Question2 = MsgBox ("Voulez-vous accéder au site "&qq(URL)&vbcr&" dans une nouvelle Fenêtre ? ",VBYesNO+VbQuestion,Titre)
If Question2 = VbYes then
	NouvelleFenetre()
else
	Wscript.Quit
end if

Sub NouvelOnglet()	
	Dim	Command1,Execuction1	
	Command1 = "Cmd /c CD %Programfiles%\Mozilla Firefox\ | Start Firefox.exe " & NewOnglet & " " & URL
	Execuction1 = Ws.Run(Command1,0,False)
End Sub

Sub NouvelleFenetre()
	Dim	Command2,Execuction2
	Command2 = "Cmd /c CD %Programfiles%\Mozilla Firefox\ | Start Firefox.exe " & NewFenetre & " " & URL
	Execuction2 = Ws.Run(Command2,0,False)
End Sub

Function qq(strIn)
	qq = Chr(34) & strIn & Chr(34)
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top