Open a website in a browser from commandline

My attempt to open a website in command prompt or a batch file.

I found that, for Windows, I could run

explorer https://waoewaoe.wordpress.com

In batch script, I can do:

start explorer https://waoewaoe.wordpress.com

Ps. Actually, I don’t really have to use start :)

In Linux, we should be able to run

firefox https://waoewaoe.wordpress.com

(if there is Firefox)

Java JDK 6 also supports it using Browse class: http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html#browse(java.net.URI)

About these ads

4 Responses to Open a website in a browser from commandline

  1. zproxy says:

    You can use explorer to choose the default browser:

    start “web” explorer “http://localhost:8080″

  2. iki says:

    Start.exe itself can open the right application associated with given file type or url type, ie. default browser for http. This works:

    start “” “http://google.com”

  3. iki says:

    Also the empty quotes “” are only needed if the file/url argument needs to be quoted, because start.exe considers the first argument a title of the new window (when possible, ie. ignored by most apps) if it is quoted. So if you do not need quoting the file/url, you can skip the empty title too:

    start http://google.com

    On linux, you can use xdg-open:

    xdg-open http://google.com

  4. Vo Duc Dien says:

    I’ve downloaded the software that does exactly this. From a command line open several websites without having to copy, paste VB scripts, batch files, etc… It’s at http://www.multiwebpageopener.com.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: