1
我正在构建一个.hta(使用javascript),我想从中启动多个应用程序。hta/javascript如何使用相对路径执行应用程序
但是,当我执行我的名.hta我得到的错误信息无法找到文件
这是代码:
<script type="text/javascript" language="javascript">
function RunFile(path) {
var relpath = window.location.href;
var fullpath = relpath + path;
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run(fullpath, 1, false);
}
RunFile("\file.exe");
</script>
有没有办法让文件本身没有位置? – user1644062
呃...我的代码就是这样。或者你的意思是没有'window.location'对象的路径? – Teemu
非常感谢你的代码作品,但是当我将地图名称中的空格替换为_时,我得到相同的错误。 – user1644062