Open a Web site in the default browser

From TheAlmightyGuru
Jump to: navigation, search

Open a Web site in the default browser is a script that will open the default Web browser in Windows to the page specified.

Batch

:: Copyright 2019, Dean Tersigni.
:: In a Windows batch file, the "start" command will launch a program, 
:: but it will also identify URLs starting with a protocol like "http://" 
:: or "ftp://" and load them in the default browser.

start http://www.thealmightyguru.com

JScript

// Copyright 2018, Dean Tersigni.
// The Shell.Run normally runs a program, but it will also identify URLs
// starting with a protocol like "http://" or "ftp://".
// If the parameter begins with "www.", a protocol of http:// is inferred.

var oShell = new ActiveXObject( "WScript.Shell" );
oShell.Run( "http://www.thealmightyguru.com" );