I know this has been answered one in another question, but I simply do not understand how it is done.
I am trying to get the output of a command line program (Aria2 downloader) into a HTA script so it can be parsed and the download percentage, file size etc can be obtained and updated into a DIV dynamically.
Here is the code I have adjusted and have been trying to use but it just locks up the interface until the command line has finished and THEN displays all the output, instead of displaying it as and when it comes through.
Const WshRunning = 0
Const WshFinished = 1
Const WshFailed = 2
strCommand = "ping.exe 127.0.0.1"
Set WshShell = CreateObject("WScript.Shell")
Set WshShellExec = WshShell.Exec(strCommand)
Do While WshShellExec.Status = WshRunning
window.setTimeOut "", 100
Loop
Select Case WshShellExec.Status
Case WshFinished
strOutput = WshShellExec.StdOut.ReadAll()
Case WshFailed
strOutput = WshShellExec.StdErr.ReadAll()
End Select
Set objItem = Document.GetElementByID("status")
objItem.InnerHTML = "" & strOutput & ""
How do I modify this so that it doesn't lock up my user interface and grabs the output and displays it in the "status" div as it comes through?