I have a batch file that does a bunch of things and at the end needs to open up a web browser to a page. Is there a way to, in essence, call ShellExecute
on a http to open the web page?
Windows Command Prompt
I have a batch file that does a bunch of things and at the end needs to open up a web browser to a page. Is there a way to, in essence, call ShellExecute
on a http to open the web page?
Windows Command Prompt
You can use the start
command to do much the same thing as ShellExecute
. For example
start "" http://www.stackoverflow.com
This will launch whatever browser is the default browser, so won't necessarily launch Internet Explorer.
C:\path\to\browser.exe http://www.stackoverflow.com
. You should ask your own question if you need more details.
Commented
Oct 21, 2015 at 17:34
start http://www.stackoverflow.com
is enough to open page in default browser.
Commented
Jan 10, 2020 at 16:30
start "http://www.stackoverflow.com"
won't work, but the command start "" "http://www.stackoverflow.com"
will. See: stackoverflow.com/questions/27261692/… and stackoverflow.com/questions/44219435/…
Commented
Jan 10, 2020 at 18:27
1.To run from the default browser, use
start http://www.stackoverflow.com
Please make sure that the appropriate browser is set as default at Control Panel-> default program :
2.To launch page from specific browser, one can use
start "iexplore.exe" http://www.stackoverflow.com
start "chrome.exe" http://www.stackoverflow.com
start "firefox.exe" http://www.stackoverflow.com
START /?
, and verify with a non-existing executable such as start "moonlanding.exe" http://nasa.gov
.
Unfortunately, the best method to approach this is to use Internet Explorer as it's a browser that is guaranteed to be on Windows based machines. This will also bring compatibility of other users which might have alternative browsers such as Firefox, Chrome, Opera..etc,
start "iexplore.exe" http://www.website.com
When you use the start command to a website it will use the default browser by default but if you want to use a specific browser then use start iexplorer.exe www.website.com
Also you cannot have http://
in the url.
hh.exe
(help pages renderer) is capable of opening some simple webpages:
hh http://www.nissan.com
This will work even if browsing is blocked through:
HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer
start
did not work for me.
I used:
firefox http://www.stackoverflow.com
or
chrome http://www.stackoverflow.com
Obviously not great for distributing it, but if you're using it for a specific machine, it should work fine.