ExciteKite Forums
Welcome, Guest
Please Login or Register.    Lost Password?
Tee vbs script for DOS (pipe to console and file) (1 viewing) (1) Guests
Go to bottom Post Reply Favoured: 0
TOPIC: Tee vbs script for DOS (pipe to console and file)
#1
wlrdq (User)
Fresh Boarder
Posts: 1
graph
User Offline Click here to see the profile of this user
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
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#2
Goodie (User)
Fresh Boarder
Posts: 1
graph
User Offline Click here to see the profile of this user
Re:Tee vbs script for DOS (pipe to console and fil 9 Months, 3 Weeks ago Karma: 0  
This _script_ changed my life.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop