Share this page 

Launch an executableTag(s): Varia

This function checks if an executable is installed and then execute it with the given parameters.

[IE only]

function exec(cmdline, params) {
  var fso = new ActiveXObject("Scripting.FileSystemObject");
  fileExist = fso.FileExists(cmdline);
  if (!fileExist) {
    alert("The requested application is not installed.");
  else {
    var shell = new ActiveXObject( "WScript.Shell" );
    if (params) {
        params = ' ' + params;
    else {
        params = '';
    shell.Run('"' + cmdline + '"' + params);

<a href="javascript:exec('C:\\Program Files\\Internet Explorer\\iexplore.exe', '-nomerge');">google (ie no merge)</a>

This code works on IE only and is considered safe in local intranet environment.

You can enable it for other environments but this can be a HUGE security risk.

In the Browser Toolbar:
     Tools -> Internet Options -> choose the Security tab
     Click the Custom Level button
     Enable the following settings:
          Run ActiveX controls and plug-ins
          Initialize and script ActiveX control not marked as safe.