Opening a File whose Name Contains a Space

♀尐吖头ヾ 提交于 2019-12-05 05:10:18

When executing the statement objshell.Run ("C:\TestFolder\Bo ok1.pdf"), you are asking the shell to execute the command

C:\TestFolder\Bo ok1.pdf

This is interpreted as being a request to execute the program C:\TestFolder\Bo.exe with a parameter of ok1.pdf.

You actually want the shell to execute the command

"C:\TestFolder\Bo ok1.pdf"

where the quotation marks are used by the command interpreter to "group" parts of the command together.

To obtain that command, you need to execute the statement

objshell.Run """C:\TestFolder\Bo ok1.pdf"""
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!