下午好!VBScript每个人都知道,createObject(WSCript.Shell)当文件路径中有空格时,要打开文件,那么你需要这样做:
Dim prog, path
Set prog = createObject("WSCript.Shell")
prog.run("""C:\Users\Me\Desktop\my file.xls""")
三引号在这里有所帮助,但如果是这样的话:
Dim prog, path
Set prog = createObject("WSCript.Shell")
path = Left(wscript.scriptfullname, (Len(wscript.scriptfullname) - Len(wscript.scriptname))) & "my file.xls"
prog.run("cmd.exe" & " " & path) 'Ошибка
那就是在这里放双引号的地方?我对某事很愚蠢。谢谢您的帮助。
多个引号只是令人困惑。最好使用适当的函数显式添加它们。首先,您可以立即看到它们的位置,其次,您不必计算报价,害怕低估或夸大它。
是的,这是可能的,但很糟糕。
所以 - 更清晰
是的,这是一个错误
所以它必须起作用。