Tee vbs script for DOS (pipe to console and file) (1 viewing) (1) Guests
Favoured: 0
|
|
|
TOPIC: Tee vbs script for DOS (pipe to console and file)
|
wlrdq (User)
Fresh Boarder
Posts: 1
|
|
Tee vbs script for DOS (pipe to console and file) 9 Months, 3 Weeks ago
|
Karma: 0  
|
|
A friend wanted to pipe the output from his console app to both a file and the console. I found that you can use tee for this in the Unix world, but didn't find anything build into DOS/Windows. To avoid having to install something (which makes IT people angry), I created a quick VB _script_:
Option Explicit
Dim WshShell Dim fso Dim oExec Dim args Dim programname Dim logfile Dim logfilename Dim char
Set args = W_script_.Arguments If args.Length dOfStream char = oExec.StdOut.Read(1) W_script_.StdOut.Write char logfile.Write char Loop
W_script_.Sleep 100 Loop
logfile.Close
Set logfile = Nothing Set fso = Nothing Set WshShell = Nothing
|
|
|
|
|
|
|
The administrator has disabled public write access. |
Goodie (User)
Fresh Boarder
Posts: 1
|
|
Re:Tee vbs script for DOS (pipe to console and fil 9 Months, 3 Weeks ago
|
Karma: 0  
|
|
This _script_ changed my life.
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
|