SH = CreateObject("WScript.Shell")
Set X = SH.Exec("YourProg")
Do While X.Status = 0
WScript.Sleep 100
Loop
While Not X.StdOut.AtEndOfStream Then
sLine = X.StdOut.ReadLine
...
Wend
Okay I guess the first part wasn't really clear.
What I need to do is:
1. Instead of doing a WScript.Echo I want to write to a designated log file. I am guessing I can just (and this is from the help manual):
set fso = CreateObject("Scripting.FileSystemObject"
set tf = fspenTextFile("c:\temp\test1.txt", ForAppending, False)
f.Write "text"
2. I am kicking off a command line process of WinZip (using wzzip.exe) using the Run method. Any error's or text that wzzip.exe might echo I want to capture.. Can I do this with the Exec method and the StdOut?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.