All,
I have a java script file that opens a notepad file but getting undefined object error. I feel this is something to do with security but not sure.. Could you please advise?
Note: Calling run function on click of a button. Error: Uncaught ReferenceError: ActiveXObject is not defined In IE - I am able to get alert 4 but can not see notepad but in Chrome getting stuck at alert 1 only.
<script language="JavaScript" type="text/javascript">
function run() {
alert("step 1");
var oShell;
oShell = new ActiveXObject("Shell.Application");
alert("step 2");
var commandtoRun = "c:\\windows\\system32\\notepad.exe";
alert("step 3");
oShell.ShellExecute(commandtoRun, "", "", "open", "1");
alert("step 4");
}
</script>
Creating an ActiveXObject on a remote server is not supported in Internet Explorer 9 standards mode, Internet Explorer 10 standards mode, Internet Explorer 11 standards mode, and Windows Store apps or later.