Open a Web Page in a Windows Batch FIle

人走茶凉 提交于 2019-11-27 09:30:55

问题


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


回答1:


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.




回答2:


unfortunatly, the best method to approach this is to use Internet Explorer as it's a browser which is garunteed 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



回答3:


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.




回答4:


Start did not work for me.

What did was use 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.



来源:https://stackoverflow.com/questions/26223936/open-a-web-page-in-a-windows-batch-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!