网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的考试资料:

 

标题 VBS中解决带空格路径的三种方法
内容
    我们在使用VBS的时候,经常会遇到路径中带有空格的状况,直接使用的话,脚本会报错,那么我们如何处理呢,这里给大家总结了常用的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
随便看

 

在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/5/17 5:25:12