Open a Web Page in a Windows Batch FIle

前端 未结 5 1660
刺人心
刺人心 2020-12-12 14:48

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, cal

相关标签:
5条回答
  • 2020-12-12 15:12

    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.

    0 讨论(0)
  • 2020-12-12 15:20

    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

    0 讨论(0)
  • 2020-12-12 15:21

    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.

    0 讨论(0)
  • 2020-12-12 15:29

    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
    
    0 讨论(0)
  • 2020-12-12 15:29

    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.

    0 讨论(0)
提交回复
热议问题