• Welcome to Windows XP Forums. Still running XP? Register for free to ask a question, reply to threads and see fewer ads.Register now

Useful .bat for programmers

Joined
Apr 14, 2025
Messages
397
It allows you to get console application output both viewable and into .txt file. Here it is:
REM start of code
@echo off
setlocal enabledelayedexpansion
set outfile=%1
:loop
set /p line=
if defined line (
echo !line!
echo !line!>>%outfile%
goto loop
)
REM end of code

On my PC, I named it tee.bat because it simulates the Tee command. Use it using:
your_program.exe | tee.bat output.txt

Hope it helps!
 
Back
Top