Can I launch URLs directly from the command line in Windows?
9 Answers
Yes, with the start command. Example:
start http://www.google.com
That will use the user's default browser.
As stated by Joey, you should use a different format for URLs with special chars:
start "" "http://www.google.com"
- 1,127
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 ?
- 323
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?
- 1,476
Here's a cheap approach that will work on XP at least:
"%PROGRAMFILES%\Internet Explorer\IExplore" "http://www.msn.com"
- 184
you can run this below command and it will redirect to google chrome browser
C:\>start 'http://www.google.com'
- 101
Using start works fine, but it leaves the browser open to the web page.
How can you connect to a URL either 1) use the browser method and automatically close the tab, or 2) do it without starting the browser?
Mark.
- 283
From C# code you could just run this (cmd-start equivalent):
Process.Start("http://stackoverflow.com");
You've launched your url from a command-line directly (i.e. without running another program first).
- 23,066