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.