Solved

Script that launches firefox and opens URL

Posted on 2011-09-23
4
343 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 45

Expert Comment

by:Martin Liss
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now