Before running the bellow script, you need to midify the setting of the internet explorer
- Open IE
- Click Tools -> Internet options
- Click security Tab
- Select local intranet (Based on your requirement)
- Click Custom level button
- find "Initialize and script ActiveX controls not marked as safe for scripting"
- Click the enable button
- Click "Ok"
- Click "OK"
- Close your browser and re-open to test it
function executeCommands()
{
var oShell = new ActiveXObject("Shell.Application");
var commandtoRun = "iexplore.exe";
oShell.ShellExecute(commandtoRun, "", "", "open", "1");
}