Search code examples
batch-filecmd

Batch opening a webpage using the default browser


How do I make a batch file open a webpage that is specified in the code with the default browser?

I found this, but it only works with Firefox and if a user doesn’t have Firefox then it won't work.

"C:\Program Files\PROGRAM" "C:\Program Files\REFERNCE FILE TO OPEN IN PROGRAM"|"C:\Program Files\PROGRAM"|"C:\Program Files\PROGRAM"|"C:\Program Files\Mozilla Firefox\firefox.exe" "http://google.com

Solution

  • The code you have is a bit overkill. Try using the following. It will use the default browser.

    START Http://www.google.com
    

    I have tested it on Windows 7 and Windows 8.