Open a Web Page in a Windows Batch FIle

WindowsBatch FileCmdShellexecute

Windows Problem Overview


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

Windows Solutions


Solution 1 - Windows

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.

Solution 2 - Windows

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

Solution 3 - Windows

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.

Solution 4 - Windows

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

Solution 5 - Windows

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 : enter image description here

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

Solution 6 - Windows

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionIan VinkView Question on Stackoverflow
Solution 1 - WindowsRoss RidgeView Answer on Stackoverflow
Solution 2 - WindowsDaryl GillView Answer on Stackoverflow
Solution 3 - Windowsuser4481177View Answer on Stackoverflow
Solution 4 - WindowsnpocmakaView Answer on Stackoverflow
Solution 5 - WindowsTilak PatilView Answer on Stackoverflow
Solution 6 - WindowsstackersView Answer on Stackoverflow