javascripthtmlwindowsbookmarklet

Web browser bookmarklet that launches an EXE on my C: drive


I wish to write a JavaScript program that executes a Windows EXE from my local C: drive. I understand the security implications, and would like to do this anyway.

I wrote a small JavaScript that's "supposed" to launch an executable. However, it does absolutely nothing.

Full path to exe:

C:\Program Files\shareURL\shareURL.exe

Code:

<script language="JavaScript" type="text/javascript">  
    MyObject = new ActiveXObject( "WScript.Shell" )  
    function RunExe()   
    {  
    MyObject.Run("file:///C:/Program%20Files/ShareURL%203/shareURL.exe") ;  
}  
</script> 
RunExe()   

I would like to make the code in a format that allows me to convert it to a web browser bookmarket using online JavaScript-->bookmarklet creators such as: Bookmarklet Creator with Script Includer

Eventually, I plan on making a browser extension that adds a button to the toolbar. However, I would like to have something close to it in the meantime.


Solution

  • Although the below solution isn't precisely what I was looking for, it's actually closer to my ultimate goal.. creating a Chromium-based browser extension that executes a Windows EXE of my choice.

    I ended up using the below Chromium/Firefox browser extension leverages node.js to execute an external EXE of my choice by just clicking on the Extension icon on my web browser's address bar:

    It's very simple to install and add my EXE for it to execute.

    https://webextension.org/listing/external-application-button.html