Hello,
is there a why to see output on screen and put logfile in txt file at the same time?
I have something like this:
for /f "tokens=1,2 delims= " %%a in (1.txt) do SOMETHING >> logfile.txt
...
...
...
for /f "tokens=1,2 delims= " %%a in (2.txt) do SOMETHING >> logfile2.txt
I dont want to use pause.
thx,
Kruno
output on display and log file
Moderator: DosItHelp
Re: output on display and log file
please look here.
Re: output on display and log file
I wrote it this way:
TEE.bat
You could use it as follows:
That's not foolproof but it's suitable to satisfy my needs.
Regards
aGerman
TEE.bat
Code: Select all
@echo off &setlocal EnableExtensions DisableDelayedExpansion
set "line=" &set "file=%~1"
if not defined file goto :eof
set "_me_=%0"
setlocal EnableDelayedExpansion
echo(!cmdcmdline!|findstr "\"/c\" !_me_!" >nul ||goto :eof
endlocal
for /f delims^=^ eol^= %%i in ('"more|findstr /n ^^"') do (
setlocal EnableDelayedExpansion
if defined line (
echo(!line:*:=!
>>"!file!" echo(!line:*:=!
)
endlocal
set "line=%%i"
)
You could use it as follows:
Code: Select all
your command here|TEE "out.txt"
That's not foolproof but it's suitable to satisfy my needs.
Regards
aGerman
Re: output on display and log file
Thank you Endoro and aGerman very much.
I test with TEE.bat and work very very nice...
You make my very hot day very pleasant.
I test with TEE.bat and work very very nice...
You make my very hot day very pleasant.
Re: output on display and log file
An equivalent but simpler solution, is this:
Code: Select all
your command here > out.txt & type out.txt