Can I launch URLs directly from the command line in Windows?
-
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– barlop2011-05-22 17:38:51 +00:00Commented May 22, 2011 at 17:38
-
You can create a local .URL file (just drag and drop the address from your browser to your desktop). Then run that URL file from your command line (with "call" or "start")Error - CPU Not Foud– Error - CPU Not Foud2024-01-11 08:04:35 +00:00Commented Jan 11, 2024 at 8:04
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"
-
52Remember to use
start "" "some://url?with=special&chars=:->"otherwise things will break.Joey– Joey2009-09-06 07:22:16 +00:00Commented Sep 6, 2009 at 7:22 -
3I need to remove the quotes, otherwise it opens a new CMD.David Gras– David Gras2017-05-26 08:53:45 +00:00Commented May 26, 2017 at 8:53
-
2@daVe you need an empty quote pair like Joey said if the url is quotedphuclv– phuclv2018-06-04 15:00:50 +00:00Commented Jun 4, 2018 at 15:00
-
2@Joey When the comment is more useful than the answer...jpmc26– jpmc262018-11-09 21:28:32 +00:00Commented Nov 9, 2018 at 21:28
-
2When the FIRST parameter has quotes, it is taken as the title of the CMD window. That's why
start "" thingierun thingie, butstart "thingie"runs CMD.Jesse Chisholm– Jesse Chisholm2021-09-02 03:12:04 +00:00Commented Sep 2, 2021 at 3:12
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 ?
-
1It's probably because
startworks for several applications (not only websites). providing at leastwwworhttp://thestartcommand links your URI to the HTTP protocol, while it could probably run other protocols.Jeff Noel– Jeff Noel2014-08-07 18:22:01 +00:00Commented Aug 7, 2014 at 18:22
You could use explorer <url> which will use your default browser.
-
@ekaj Your right :/ First time i tried it it didn't work - for some reason it now worked ... comment deleted2014-11-24 20:04:02 +00:00Commented Nov 24, 2014 at 20:04
-
Windows Server 2016: First time it displays a prompt asking you to choose a default browser, with a checkbox asking "Always use this app".mozey– mozey2020-11-18 11:22:37 +00:00Commented Nov 18, 2020 at 11:22
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?
Here's a cheap approach that will work on XP at least:
"%PROGRAMFILES%\Internet Explorer\IExplore" "http://www.msn.com"
-
15Ouch... and msn.com no less.harpo– harpo2009-09-06 05:09:11 +00:00Commented Sep 6, 2009 at 5:09
-
first thing that came to mind...for no apparent reason whatsoeverDavid Andres– David Andres2009-09-06 06:38:35 +00:00Commented Sep 6, 2009 at 6:38
-
-
1@Kazark: cheap in that it opens up the URL in Internet Explorer as opposed to whatever the default browser happens to be.David Andres– David Andres2014-08-11 11:44:35 +00:00Commented Aug 11, 2014 at 11:44
you can run this below command and it will redirect to google chrome browser
C:\>start 'http://www.google.com'
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.
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).
-
Is this
C#? This does not work for me on Windows 7 usingcmd.exe.iglvzx– iglvzx2012-06-06 19:06:31 +00:00Commented Jun 6, 2012 at 19:06 -
2Tried this in PowerShell and it didn't work. Must be C#. Does this really answer the question?Kazark– Kazark2014-08-07 17:56:19 +00:00Commented Aug 7, 2014 at 17:56
-
2This is not CMD syntax, nor does it seem to be valid Powershell. I could remove my downvote if the poster updated his answer with details.oligofren– oligofren2017-01-05 12:10:02 +00:00Commented Jan 5, 2017 at 12:10