VBS中解決帶空格路徑的三種方法
更新時(shí)間:2015年09月25日 10:10:33 投稿:hebedich
我們?cè)谑褂肰BS的時(shí)候,經(jīng)常會(huì)遇到路徑中帶有空格的狀況,直接使用的話,腳本會(huì)報(bào)錯(cuò),那么我們?nèi)绾翁幚砟兀@里給大家總結(jié)了常用的3個(gè)方法,有需要的小伙伴可以參考下。
方法一:
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
相關(guān)文章
把vbscript發(fā)揮到它的極限應(yīng)用之一(數(shù)組)!??!
把vbscript發(fā)揮到它的極限應(yīng)用之一(數(shù)組)?。。?..2007-05-05VBS教程:VBScript 基礎(chǔ)-VBScript 常數(shù)
VBS教程:VBScript 基礎(chǔ)-VBScript 常數(shù)...2006-11-11不錯(cuò)的一篇VBS-JSCRIPT GETOBJECT理解
不錯(cuò)的一篇VBS-JSCRIPT GETOBJECT理解...2007-03-03