0

There is an html file which has the paths of various .txt files. I wish to add hyperlink to the such that on clicking on those files, they get opened in the NOTEPAD EDITOR instead of the web browser.

Surfing on net gave me the following solution using ActiveXObject.

<html>
<head>
    <script type="text/javascript">
    function runProgram()
    {
        var shell = new ActiveXObject("WScript.Shell");                 
        var appNotepad = "\"C:\\Windows\\System32\\Notepad.exe\"";
        var fileOpen = "\"C:\\AnyFolder\\sample.txt\"";
        shell.Run(appNotepad + " " + fileOpen);
    }
    </script>
</head>

<body>
    <a href="javascript:runProgram()">Click Me</a>
</body>

But the solution works only in IE. I wish to have a solution which works in any browser.

I also got a solution which is for cross browser alternative for ActiveXobject but they are for XML parsing, which I don't need.

Another thing which I came across is Cross Browser XML HTTP REQUEST but can't figure out how can this help.

So, please help me to find the solution of this.

Community
  • 1
  • 1
  • thankfully, you can't do it, it's my browser, I decide what to do with .txt files :p – Jaromanda X Jul 20 '15 at 11:28
  • Actually the whole scenario is that I have a program which gives a list of files, based on some particular input. The program is supposed to run on any box (be it windows or linux server). I wish to give the end-user the option of modifying the files (which is listed in the output). So, is there no option of doing it? – Akash Hazra Jul 20 '15 at 11:44

0 Answers0