[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 398
  • Last Modified:

Script that launches firefox and opens URL

I need a script that will open firefox and open a url. I have created a .bat script but the command prompt windows stays open which i cannot have happen.
0
zingab
Asked:
zingab
1 Solution
 
Martin LissRetired ProgrammerCommented:
ShellExecute 0, "open", _
            "C:\Program Files\Mozilla Firefox\Firefox.exe", _
            strMyURL, vbNullString, 1

Open in new window

0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
In a (dos) batch file you can use 'start' to launch a command and then exit the batch file, like this:

start <path>\firefox.exe "http://www.experts-exchange.com"
exit

Open in new window


Where <path> is where you've got firefox installed.
0
 
PakaCommented:
Save this to a file named lff.vbs:
----------------
shell """C:\Program Files\Mozilla Firefox\firefox.exe""yoururl.com"

Sub shell(cmd)
  dim objShell
  Set objShell = WScript.CreateObject( "WScript.Shell" )
  objShell.Run(cmd)
  Set objShell = Nothing
end Sub
----------------

You can call this from a batch file using:
"cscript lff.vbs"
0
 
zingabAuthor Commented:
Thank you!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now