Функция RunCommandLine.
Function RunCommandLine(ByVal strCommand, ByVal blnShowOutput)
  Dim objWshShell       ? Instance of the WshShell object
  Dim objWshScriptExec  ? Instance of the WshScriptExec object
  Set objWshShell = CreateObject(«Wscript.Shell»)
  Set objWshScriptExec = objWshShell.Exec(strCommand)
  Do While objWshScriptExec.Status = 0  ? Running
    Wscript.Sleep 100
  Loop
  ? Display the program?s standard output if requested
  If blnShowOutput Then Wscript.Stdout.Write objWshScriptExec.StdOut.ReadAll
  ? Return the command?s exit code
  RunCommandLine = objWshScriptExec.ExitCode
End Function

Поделитесь материалом с коллегами и друзьями