脚本专栏 
首页 > 脚本专栏 > 浏览文章

VBS中解决带空格路径的三种方法

(编辑:jimmy 日期: 2024/12/23 浏览:3 次 )

方法一:

Set wshell=CreateObject("WScript.Shell")
wshell.Run """C:\Program Files\360\360se\360se.exe""",5,True
Set wshell = Nothing

方法二:

temp="C:\Program Files\360\360se3\360se.exe"
path = Chr(34) & temp & Chr(34)
Set wshell=CreateObject("WScript.Shell")
wshell.Run path,1,True
Set wshell = Nothing
 

方法三:

Public Const vbQuote = """"
temp="C:\Program Files\360\360se3\360se.exe"
path = vbQuote & temp & vbQuote
Set wshell=CreateObject("WScript.Shell")
wshell.Run path,1,True
Set wshell = Nothing

上一篇:VBS实现查询服务的制造商
下一篇:使用vbs删除host文件域址内容