‘ Mit VBScript Konsolenausgabe kidnappen bzw. abfangen

WScript.Echo Executekonsole(“echo %time%”) ‘ Konsolenbefehl der gekidnappt bzw. abgefangen werden soll

Function ExecuteKonsole(ByVal befehl) ‘ Subroutine Konsolenausgabe kidnappen bzw. abfangen
Const WshRunning = 0
Set wshshell = CreateObject(“WScript.Shell”)
kommando = “%comspec% /c ” & befehl

Set objProc = wshshell.Exec(kommando)
Do While objProc.Status = WshRunning
ExecuteKonsole = ExecuteKonsole & objProc.StdOut.ReadAll
Loop
End Function


Leave a Comment


You must log in to post a comment.