,没关系,我解决了。
它应该是
<a href="#" onclick="runnp()">Run notepad.exe</a>原始问题:
我正在尝试写一个网页,它将在我的本地计算机上启动程序。为什么只有vbscript版本才能工作?当我单击jscript链接时,什么都不会发生。
<html>
<head>
<script language="VBScript">
Sub RunProgram
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "notepad.exe"
End Sub
</script>
<script language="jscript">
function runnp() {
File="notepad.exe";
objShell = new ActiveXObject("WScript.Shell");
objShell.run(File);
}
</script>
</head>
<body>
<a href="#" onclick="RunProgram">Run Program</a>
<A href="#" onClick="runnp(); return false;">Run notepad.exe</A>
</body>
</html>如何使jscript版本工作?(IE8 on XPsp2)
发布于 2010-09-14 19:18:27
这似乎是可行的:
<A href="#" onClick="runnp()">Run notepad.exe</A>我不知道/明白为什么你的样品不!
https://stackoverflow.com/questions/3527327
复制相似问题