如何使用WScript.Shell打开pdf [英] How to open a pdf with WScript.Shell
本文介绍了如何使用WScript.Shell打开pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在创建需要打开PDF文档的HTA应用程序.我不能假设用户将在此PC上安装acrobat,如下面的示例
I'm creating a HTA application that needs to open PDF document. I cannot assum that the user will have acrobat installed on his PC as in this example
WScript(文档 )允许您运行命令行应用程序.但是我想让WScript模拟该文件的双击.
The WScript (documentation) allow you to run a command line application. But what I would like, is for the WScript to simulate a double click on the file.
我希望能够做类似
var wshShell = new ActiveXObject("WScript.Shell");
wshShell.Exec(pdfFilePath); // That does not work
推荐答案
方法是:
new ActiveXObject("WScript.Shell").Run(pdfFile,1,false);
这篇关于如何使用WScript.Shell打开pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文