我正在创建一个需要打开 PDF 文档的 HTA 应用程序。我不能假设用户将在其 PC 上安装 acrobat,如 example 所示。
WScript ( documentation ) 允许您运行命令行应用程序。但我想要的是 WScript 模拟双击文件。
我希望能够做类似的事情
var wshShell = new ActiveXObject("WScript.Shell");
wshShell.Exec(pdfFilePath); // That does not work
最佳答案
在cmd
中,您可以打开这样的文件:start c:\path\to\file.pdf
也许这有效
wshShell.Exec("start " & pdfFilePath); //do you do string concat like this in wscript?
关于javascript - 如何使用 WScript.Shell 打开 pdf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7027698/