📜  vbs 使用 cscript 运行 - VBA 代码示例

📅  最后修改于: 2022-03-11 14:51:55.753000             🧑  作者: Mango

代码示例1
Set oShell = CreateObject("WScript.Shell")

If Not LCase(Right(WScript.FullName, 12)) = "\cscript.exe" Then
  For Each Arg In WScript.Arguments
    If InStr(Arg, " ") Then Arg = """" & Arg & """"
      Str = Str & " " & Arg
  Next
  cmd = "cscript //nologo """ & WScript.ScriptFullName & """ " & Str
  oShell.Run cmd, 0, false
  WScript.Quit
End If