Solved

Script that launches firefox and opens URL

Posted on 2011-09-23
4
361 Views
Last Modified: 2012-05-12
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
Comment
Question by:zingab
4 Comments
 
LVL 46

Expert Comment

by:Martin Liss
ID: 36588743
ShellExecute 0, "open", _
            "C:\Program Files\Mozilla Firefox\Firefox.exe", _
            strMyURL, vbNullString, 1

Open in new window

0
 
LVL 37

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 36588786
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
 
LVL 22

Accepted Solution

by:
Paka earned 500 total points
ID: 36588822
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
 

Author Closing Comment

by:zingab
ID: 36589111
Thank you!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question