【发布时间】:2014-06-27 11:14:52
【问题描述】:
我只想使用 html Js 打开一个 notepade.exe,我尝试了这段代码,但它不起作用任何人都可以帮助我解决这个问题。这个文件是run.html !!!
<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>
【问题讨论】:
-
定义“它不工作”。怎么了?你有错误吗?
-
我刚刚使用了记事本,可以在控制台中看到错误提示“未捕获的 ReferenceError:ActiveXObject 未定义”
-
@VigneshMarteen 您是否尝试在 Internet Explorer 中运行此代码? ActiveXObject 只能在 IE 中使用。
-
嗨 Dean.DePue,我尝试了相同的链接并将输出复制并粘贴到此处。即使它没有运行。
标签: javascript html asp-classic activex