How to open a pdf with WScript.Shell

*爱你&永不变心* 提交于 2019-12-03 21:53:35

In cmd, you can open a file like this: start c:\path\to\file.pdf

Maybe this works

wshShell.Exec("start " & pdfFilePath); //do you do string concat like this in wscript?

If pdfFile contains space, you must be add " and " into start and end of pdfFilePath Change to: wshShell.Run('cmd /C start '+ '\"' + pdfFile + '\"' ,1,false)

The way to do this is:

new ActiveXObject("WScript.Shell").Run(pdfFile,1,false);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!