Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

can I launch urls from command line(windows) directly.

share|improve this question
3  
@Isaac, have you heard of superuser? –  hasenj Sep 6 '09 at 5:12
    
yeah should have gone to Super User instead. –  Mauris Sep 6 '09 at 6:22
    
I always thought iexplore www.google.com would work i'm sure i've done it in the past loads of times, but it didn't. So, stick c:\program files\internet explorer, in the path and it will. Personally I make another environment variable for long boring stuff like MOREPATH="c:\program files\internet explorer". Then path=.......;%MOREPATH% That's in control panel..system..environment variables. now iexplore www.google.com will damn well work! –  barlop May 22 '11 at 17:38
add comment

migrated from stackoverflow.com Sep 6 '09 at 18:37

This question came from our site for professional and enthusiast programmers.

5 Answers

Yes, with the start command. Example:

start "http://www.google.com"

That will use the user's default browser.

share|improve this answer
8  
Remember to use start "" "some://url?with=special&chars=:->" otherwise things will break. –  Joey Sep 6 '09 at 7:22
add comment

What's "launch" in this context? You can start http://www.foo.bar/ or the like, your default browser will come up and visit that URL -- is that what you mean?

share|improve this answer
add comment

Here's a cheap approach that will work on XP at least:

"%PROGRAMFILES%\Internet Explorer\IExplore" "http://www.msn.com"
share|improve this answer
7  
Ouch... and msn.com no less. –  harpo Sep 6 '09 at 5:09
    
first thing that came to mind...for no apparent reason whatsoever –  David Andres Sep 6 '09 at 6:38
add comment

you can use

start http://www.google.com

Interestingly only following combination are working for above url :

start www.google.com
start http://google.com
start http://blog.google.com

But following is not working :

start google.com
start asp.net
start blog.google.com

I think it is because in the later example google.com and asp.net are treated as files and it tries to find google.com file and gives error on not finding it.

I think it is hardcoded for www. Any better guesses ?

share|improve this answer
add comment
Process.Start("http://stackoverflow.com");

You've launched your url from a command-line directly (i.e. without running another program first).

share|improve this answer
    
Is this C#? This does not work for me on Windows 7 using cmd.exe. –  iglvzx Jun 6 '12 at 19:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.