I want to achieve this in a CA as anything with terminal output just gets lost is I use the WsShell.Run method: -
'************************************************************
' Subroutine: ExecuteWithTerminalOutput
'
' Description:
' Execute a command from the shell and wait for it to finish.
' It also captures output properly.
'
' Parameters: strFilePath File to run.
' strWorkingDirectory Directory to run command in.
'
' Notes: Use this when using e.g. (DOS) redirected output to file.
'************************************************************
Function ExecuteWithTerminalOutput(cmd)
Dim sh
Dim exec
Set sh = WScript.CreateObject("WScript.Shell")
Set exec = sh.Exec(cmd)
Do While exec.Status = 0
WScript.Sleep 100
WScript.StdOut.Write(exec.StdOut.ReadLine())
WScript.StdErr.Write(exec.StdErr.ReadLine())
Loop
ExecuteWithTerminalOutput = exec.Status
End Function
FOLLOW US
Get the latest news in Application Packaging