I am using WScript.Shell in order to execute a batch file that runs a few commands with a large output that is redirected to a local text file.
When execution is finished, I read the text file and update a scrolling DIV on my html page with the output from the batch file.
Something like this:
Expand|Select|Wrap|Line Numbers
- Cmd="%comspec% /c script.bat > c:\output.txt"
- Exec=WshShell.Run(Cmd,0, true);
- fso = new ActiveXObject("Scripting.FileSystemObject");
- ts = fso.OpenTextFile("C:\\output.txt", 1);
- msg = ts.ReadAll();
- var output = document.createElement('font');
- output.innerHTML=msg;
- div.appendChild(output);
My question is :
Is there anyway I can dynamically update my div with the content of the growing text file ?
Any suggestions will be great !
Thanks