I've been working on a JavaScript code to execute a shell command and open Notepad. Below is my current implementation:
<script type="text/javascript">
function runNotepad() {
var oShell = new ActiveXObject("Shell.Application");
var commandtoRun = "C:\\WINDOWS\\Notepad.exe";
oShell.ShellExecute(commandtoRun, null, "", "open", "1");
}
</script>
However, when attempting to run this code, I encounter an error message stating
Microsoft JScript runtime error: Permission denied
.
I have already enabled
Allow active content to run in files on my computer
in IE
, but unfortunately, it did not solve the issue.
Can anyone provide insight into what could be missing or causing this problem?