我能';t使用Javascript打开exe
我只想用html Js打开一个notepade.exe,我试过这段代码,但它不起作用,任何人都能帮我解决这个问题。这个文件是run.html我能';t使用Javascript打开exe,javascript,html,asp-classic,activex,Javascript,Html,Asp Classic,Activex,我只想用html Js打开一个notepade.exe,我试过这段代码,但它不起作用,任何人都能帮我解决这个问题。这个文件是run.html <html> <head> <script> alert("hi"); <!-- myWindow.close(); --> var param1var = window.location.search.replace( "?", "" ); alert(para
<html>
<head>
<script>
alert("hi");
<!-- myWindow.close(); -->
var param1var = window.location.search.replace( "?", "" );
alert(param1var);
var oShell = new ActiveXObject("Shell.Application");
var commandtoRun = "C:\\Windows\\notepad.exe";
oShell.ShellExecute(commandtoRun,"","","open","1");
window.close()
</script>
</head>
</html>
警报(“hi”);
var param1var=window.location.search.replace(“?”,”);
警报(param1var);
var oShell=新的ActiveXObject(“Shell.Application”);
var commandtoRun=“C:\\Windows\\notepad.exe”;
ShellExecute(commandtoRun,“,”,“open”,“1”);
window.close()
打开Internet Explorer并更改/启用这两个设置
工具>Internet选项>安全性>自定义级别>ActiveX控件和插件>初始化和编写未标记为脚本安全的ActiveX控件
工具>Internet选项>高级>安全性>允许活动内容在我的计算机上的文件中运行
以防万一,重新启动Internet Explorer定义“它不工作”。会发生什么?您是否收到错误?可能与我刚才使用的记事本重复,并且可以在控制台中看到一个错误:“未捕获引用错误:未定义ActiveXObject”@VigneshMarteen您是否尝试在Internet Explorer中运行此代码?ActiveXObject只能在IE.hi Dean.DePue中使用,我尝试了相同的链接,复制了输出并粘贴到这里。即使它没有运行。