Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Batch Files - show output on screen AND file

24,324 views
Skip to first unread message

techman41973

unread,
Dec 4, 2010, 4:25:41 AM12/4/10
to
I know you can pipe the output of a batch file to a text file
such as launch.bag > log_file.txt
but this turns off the output on the screen.
Is there a way to keep the output on the screen AND write the output
to a text file?
I searched the archive of this newsgroup and did a google web search
and can't find a conclusive answer to this question.

foxidrive

unread,
Dec 4, 2010, 4:51:44 AM12/4/10
to
On 4/12/2010 20:25, techman41973 wrote:
> I know you can pipe the output of a batch file to a text file
> such as launch.bag> log_file.txt
> but this turns off the output on the screen.
> Is there a way to keep the output on the screen AND write the output
> to a text file?

Use a TEE filter.

--
Regards,
Mic

Ted Davis

unread,
Dec 4, 2010, 10:45:56 AM12/4/10
to

There is no direct solution using only Windows native commands and
utilities, but as is so often the case, there are free ports of Unix/
Linux utilities that perform the function. In this case, the tee utility
from the CoreUtils package at
http://gnuwin32.sourceforge.net/packages/coreutils.htm
is the appropriate tool.

Usage: tee [OPTION]... [FILE]...
Copy standard input to each FILE, and also to standard output.

-a, --append append to the given FILEs, do not overwrite
-i, --ignore-interrupts ignore interrupt signals
--help display this help and exit
--version output version information and exit

If a FILE is -, copy again to standard output.


The help switch is --help. not /?

--
Ted Davis (tda...@mst.edu)

Tim Meddick

unread,
Dec 5, 2010, 3:43:50 AM12/5/10
to
Simply use *two* batch files - "nested"

i.e.

Batch#1
call Batch#2 > output.txt
call Batch#2

Batch#2
(contains: the original contents of your batch file)


...thus, Batch #2 (your original batch file) is called twice - once to
re-direct it's
output to the text file, and then again so you can see the output on the
screen also!

==

Cheers, Tim Meddick, Peckham, London. :-)


"techman41973" <techma...@yahoo.com> wrote in message
news:441067af-4ddc-47ea...@u9g2000pra.googlegroups.com...

foxidrive

unread,
Dec 5, 2010, 4:26:19 AM12/5/10
to
On 5/12/2010 19:43, Tim Meddick wrote:
> Simply use *two* batch files - "nested"
>
> i.e.
>
> Batch#1
> call Batch#2 > output.txt
> call Batch#2
>
> Batch#2
> (contains: the original contents of your batch file)
>
>
> ....thus, Batch #2 (your original batch file) is called twice - once to

> re-direct it's
> output to the text file, and then again so you can see the output on the
> screen also!
>
> ==
>
> Cheers, Tim Meddick, Peckham, London. :-)

That's a big fail Tim. :)


--
Regards,
Mic

Tim Meddick

unread,
Dec 5, 2010, 5:04:07 AM12/5/10
to
Oh for God's sake - it's not rocket science - use a bit of imagination will
you ....


(Batch#1.bat)
@echo off
call Batch#2.bat >output.txt
call Batch#2.bat

(Batch#2.bat)
@echo off
find /i "arrogance" idiots.xml


...create two files called (Batch#1.bat) & (Batch#2.bat) with the contents
above and it bloody well will work!

Obviously some output from programs don't redirect, so it absolutely
depends on the [console] program you are executing from (Batch#2.bat).

However, my example above; works.

==

Cheers, Tim Meddick, Peckham, London. :-)


"foxidrive" <foxi...@gotcha.woohoo.invalid> wrote in message
news:%UIKo.2186$3g....@newsfe05.iad...

Tim Meddick

unread,
Dec 5, 2010, 5:08:29 AM12/5/10
to
A Post Script -

Again - obviously - the two batch files are dependant upon a third file
called "idiots.xml" existing, and helpfully containing the word
"arrogance".

But, you could substitute *any* command for the line :

"find /i "arrogance" idiots.xml"

...that accepts re-directed screen output.

foxidrive

unread,
Dec 5, 2010, 7:10:29 AM12/5/10
to
On 5/12/2010 21:08, Tim Meddick wrote:

> Batch#1
> call Batch#2 > output.txt
> call Batch#2
>
> Batch#2
> (contains: the original contents of your batch file)
>
>
> ....thus, Batch #2 (your original batch file) is called twice - once
> to re-direct it's
> output to the text file, and then again so you can see the output on
> the screen also!

> A Post Script -
>
> Again - obviously - the two batch files are dependant upon a third file
> called "idiots.xml" existing, and helpfully containing the word
> "arrogance".
>
> But, you could substitute *any* command for the line :
>
> "find /i "arrogance" idiots.xml"
>

> ....that accepts re-directed screen output.
>

Dwell on this scenario Tim:

You have a batch file which copies files to another drive, if they don't
exist.

How will your second invocation of the same batch file work in
displaying the information to the screen?

--
Regards,
Mic

Ted Davis

unread,
Dec 5, 2010, 10:12:12 AM12/5/10
to
On Sun, 05 Dec 2010 08:43:50 +0000, Tim Meddick wrote:

> Simply use *two* batch files - "nested"
>
> i.e.
>
> Batch#1
> call Batch#2 > output.txt
> call Batch#2
>
> Batch#2
> (contains: the original contents of your batch file)
>
>
> ...thus, Batch #2 (your original batch file) is called twice - once to
> re-direct it's
> output to the text file, and then again so you can see the output on the
> screen also!

A trivial counterexample:

BATCH2.cmd
dir %temp%
del %temp%\*.*

--
Ted Davis (tda...@mst.edu)

Vic RR Garcia

unread,
Dec 5, 2010, 10:52:58 AM12/5/10
to

This will do:

Echo OFF
dir c*.* /b > log_file.txt
copy log_file.txt con:


Create your log file using normal re-direct, then copy the log file to
the Console.

foxidrive

unread,
Dec 5, 2010, 11:03:20 AM12/5/10
to
On 6/12/2010 02:52, Vic RR Garcia wrote:
> On 12/4/2010 04:25, techman41973 wrote:
>> I know you can pipe the output of a batch file to a text file
>> such as launch.bag> log_file.txt
>> but this turns off the output on the screen.
>> Is there a way to keep the output on the screen AND write the output
>> to a text file?

> This will do:


>
> Echo OFF
> dir c*.* /b > log_file.txt
> copy log_file.txt con:
>
> Create your log file using normal re-direct, then copy the log file to
> the Console.

The issue with that is that it is not real time - and if you want a Tee
filter then the user is watching the batch file run in some cases.

Here are some solutions from a past discussion on the topic:

:: On 4/09/2010 23:54, I'm_HERE wrote: wali...@gmail.com

@echo off

Set "$h=^^^!!!%%&!><?*|^abc!123"
call :tee $h
pause
goto :eof

:tee
setlocal enabledelayedexpansion
echo !%~1!
echo:!%~1!>>tee.txt
endlocal & goto :eof

--
Regards,
Mic

foxidrive

unread,
Dec 5, 2010, 11:04:15 AM12/5/10
to
On 6/12/2010 02:52, Vic RR Garcia wrote:
> On 12/4/2010 04:25, techman41973 wrote:
>> I know you can pipe the output of a batch file to a text file
>> such as launch.bag> log_file.txt
>> but this turns off the output on the screen.
>> Is there a way to keep the output on the screen AND write the output
>> to a text file?

> This will do:


>
> Echo OFF
> dir c*.* /b > log_file.txt
> copy log_file.txt con:
>
> Create your log file using normal re-direct, then copy the log file to
> the Console.

--
Regards,
Mic

foxidrive

unread,
Dec 5, 2010, 11:07:27 AM12/5/10
to
On 6/12/2010 02:52, Vic RR Garcia wrote:
> On 12/4/2010 04:25, techman41973 wrote:
>> I know you can pipe the output of a batch file to a text file
>> such as launch.bag> log_file.txt
>> but this turns off the output on the screen.
>> Is there a way to keep the output on the screen AND write the output
>> to a text file?

> This will do:


>
> Echo OFF
> dir c*.* /b > log_file.txt
> copy log_file.txt con:
>
> Create your log file using normal re-direct, then copy the log file to
> the Console.

The issue with that is that it is not real time - and if you want a Tee
filter then the user is watching the batch file run in some cases.


Here are some solutions from a past discussion on the topic:


:: On 4/09/2010 23:54, I'm_HERE wrote: wali...@gmail.com
@echo off
Set "$h=^^^!!!%%&!><?*|^abc!123"
call :tee $h
pause
goto :eof
:tee
setlocal enabledelayedexpansion
echo !%~1!
echo:!%~1!>>tee.txt
endlocal & goto :eof

:: by Tom Lavedas
@echo off
> TFILTER.VBS echo. sLogName="Logfile.log" ' default name
>>TFILTER.VBS echo. if WSH.Arguments.Count^>0 then
sLogName=WSH.Arguments(0)
>>TFILTER.VBS echo. with CreateObject("Scripting.FileSystemObject")_
>>TFILTER.VBS echo. .OpenTextFile(sLogName, 8, true)
>>TFILTER.VBS echo. .WriteLine Now
>>TFILTER.VBS echo. Do Until WSH.StdIn.AtEndOfStream
>>TFILTER.VBS echo. str = WSH.StdIn.ReadLine
>>TFILTER.VBS echo. wsh.echo str : .WriteLine str
>>TFILTER.VBS echo. Loop
>>TFILTER.VBS echo. end with ' FSO
(echo === Started ====
copy *.bat "c:\folder" /y
echo ====text here=== )|cscript //nologo TFILTER.VBS MyLogFile.txt
del TFILTER.VBS


:: tee.bat - idea from Joachim Hofmann
:: Syntax: TEE logfilename.log dos_command_to_capture
:: Example: tee logfile.log COPY "c:\myfolder\*.txt" "d:\backup\"
:: tee "My log.log" dir c:\*.sys /b
@ECHO OFF
set logfile="%~1"
if exist %logfile% del %logfile%
set "var=%*"
set "var=%var:*.log =%"
set "var=%var:*.log" =%"
for /F "tokens=1* delims=]" %%a IN (
'%var% 2^>^&1^|find /v /n ""'
) DO (
set /p"=%%b"<nul
echo.
set /p"=%%b"<nul>>%logfile%
echo.>>%logfile%
)
pause


--
Regards,
Mic

FileGod

unread,
Dec 6, 2010, 7:01:46 AM12/6/10
to
techman41973 <techma...@yahoo.com> wrote:
>I know you can pipe the output of a batch file to a text fileô such as
>launch.bag > log_file.txtçbut this turns off the output on the screen.

>such as launch.bag > log_file.txt
>but this turns off the output on the screen.
>Is there a way to keep the output on the screen AND write the output
>to a text file?

Yes, if you use the and symbol...
type launch.bag > log_file.txt & type launch.bag > log_file.txt

http://www.filegod.netfirms.com

foxidrive

unread,
Dec 6, 2010, 7:11:54 AM12/6/10
to

What have you been smoking, Filegod? ;)

Seriously, I'm not sure what you thought you were typing.


--
Regards,
Mic

billious

unread,
Dec 6, 2010, 7:36:49 AM12/6/10
to

"foxidrive" <foxi...@gotcha.woohoo.invalid> wrote in message
news:fq4Lo.433$L%.390@newsfe03.iad...

>> Yes, if you use the and symbol...
>> type launch.bag> log_file.txt& type launch.bag> log_file.txt
>
> What have you been smoking, Filegod? ;)
>
> Seriously, I'm not sure what you thought you were typing.
>
Too many happy pills in his launch.bag ?


FileGod

unread,
Dec 6, 2010, 1:57:47 PM12/6/10
to

I was not smoking, I was falling asleep
Huh, I thought it would work since this does:
dir & dir>>some.txt

This works:
type 1.txt & type 1.txt >>2.txt

http://www.filegod.netfirms.com

Todd Vargo

unread,
Dec 6, 2010, 7:12:43 PM12/6/10
to

For that matter, how will deleting files go on the second invocation?

--
Todd Vargo

(Post questions to group only. Remove "z" to email personal messages)

Todd Vargo

unread,
Dec 6, 2010, 7:26:02 PM12/6/10
to

"FileGod" <0@0.0> wrote in message news:idjbnb$3jc$1...@speranza.aioe.org...

You are still not getting it.

Tim's two batch method...

call 4hour_backup.bat
call 4hour_backup.bat >> log

is the same thing as this...

call 4hour_backup.bat & call 4hour_backup.bat >> log

So how long will a 4 hour backup take to complete twice?

Tim Meddick

unread,
Dec 7, 2010, 3:57:40 AM12/7/10
to
Yes, very good, now you've made your attempt to make others look like
complete idiots....

Yes, indeed though, it is an inescapable fact you have drawn my attention
to.

Not so much the 4-hour-putdown in response to poor old "Filegod",....

But the citation of what would happen on copying files when they don't
exist in the destination ("foxidrive") and your own comment thrown in about
deleting files as well.

Of course my idea of repeating two batch-files will not work if the
conditions cannot be repeated by issuing the same commandline twice in a
row.

But having said that - there must be simply billions of instances when this
solution *would* meet the requirements of the OP.

==

Cheers, Tim Meddick, Peckham, London. :-)


"Todd Vargo" <tlv...@sbcglobal.netz> wrote in message
news:idjuvj$qgs$1...@news.albasani.net...

FileGod

unread,
Dec 7, 2010, 4:56:33 AM12/7/10
to
"Todd Vargo" <tlv...@sbcglobal.netz> wrote:
>You are still not getting it.

Oh really?
The directory can be grafted to another directory such as:
ren "program files\some dir" c:\backup
One thing is he never did state the operating system soI wrote it
to make it run DOS 6.22 to Win XP since this is alt.msdos.batch
not alt.msdos.batch.nt, I am looking at the EXACT topic & I have
seen someone else did a reply using (FOR & TOKENS) but if he is using
DOS 6.22 TOKENS would not work, my opinion is that he is running
Win XP.
Trust me Todd, when I did change to XP you were a big help to me
when I was converting over, I think a lot of the old DOS gets
forgotten when folks get away from DOS 6.22-Win9x.
I do consider the Command Interpreter in Win XP the best I did
try yet.
I am waiting to see the OP do a reply since it could be a waste
of my time to just guess what the exact results he wants but I do
think he wants to use use (tokens)(for/f)&(xcopy).
My first ness up was I had the (&) in the batch file without
a space so it ended up as part of the directory name...

I still would like to see you start a web site, I would even
help you by slapping a Perl search engine in there!

FileGod

unread,
Dec 7, 2010, 5:48:01 AM12/7/10
to
"Todd Vargo" <tlv...@sbcglobal.netz> wrote:
>For that matter, how will deleting files go on the second invocation?
ren is far faster than xcopy, ren by date would be the best!

Todd Vargo

unread,
Dec 7, 2010, 7:16:36 PM12/7/10
to
Tim Meddick wrote:
> Yes, very good, now you've made your attempt to make others look like
> complete idiots....

No, I have attempted to get you to stop and think for a moment just exactly
why yours and FileGod's suggestions will fail to do what the OP requested
(and ancient FAQ around here).

>
> Yes, indeed though, it is an inescapable fact you have drawn my attention
> to.
>
> Not so much the 4-hour-putdown in response to poor old "Filegod",....
>
> But the citation of what would happen on copying files when they don't
> exist in the destination ("foxidrive") and your own comment thrown in
> about deleting files as well.
>
> Of course my idea of repeating two batch-files will not work if the
> conditions cannot be repeated by issuing the same commandline twice in a
> row.

Good, you have seen the light on this problem then (although not with top
posting).

>
> But having said that - there must be simply billions of instances when
> this solution *would* meet the requirements of the OP.

Only if you know what the batch does prior to attempting to use it. There
are too many more instances where this method could have catostrophic
effects by not knowing what the batch actually does prior to suggesting to
someone without batch knowledge to go ahead and try it.

Todd Vargo

unread,
Dec 7, 2010, 7:11:07 PM12/7/10
to
FileGod wrote:

> "Todd Vargo" wrote:
>>For that matter, how will deleting files go on the second invocation?
> ren is far faster than xcopy, ren by date would be the best!

Sanity check...

Apparently, there are multiple discussions going on in this thread.
Obviously, the original one was to answer the OP's question, which was to
send output of a batch file to a text file as well as to screen at the same
time. This question has been a long time FAQ here. The best possible
solution (a TEE filter) has already been suggested as both a downloadable
binary as well as a VBScript solution.

An attempt (by Tim Meddick) to offer a solution by running the batch twice
by using a second batch which started an obtuse discussion about, how this
is not rocket science, but Tim continued to ignore the fact that running the
same batch twice just to redirect and display the output can cause major
failures. One obvious mode of failure as I pointed out is; if the batch was
intended to delete files, then first invocation will delete the files while
the second invocation will have nothing to display because the files were
already deleted.

Meanwhile in a separate thread, FileGod suggested using the & symbol. An
example was included to use TYPE to send the contents of an arbitrary file
to another file and used the & to repeat the process. Additional attempts to
provide examples in that thread using DIR and then with TYPE again and then
with REN, still oblivious to the original request to send output of a
(complete) batch file to a text file as well as to screen at the same time.

Which brings us to the response above. I don't know how a comparison of REN
to XCOPY or REN by date became part of this discussion (to send output of a
batch file to a text file as well as to screen at the same time) or how they
even remotely relate to it. <shrug>

Todd Vargo

unread,
Dec 7, 2010, 7:30:41 PM12/7/10
to

What would be the point to create yet another website that people wont read
because they don't know the right questions or terminology to input into a
search engine? Prof. Timo already posts a weekly FAQ which leads to his site
which contains links to many existing sites that for whatever reason, people
are just not finding their answers prior to posting.

Tim Meddick

unread,
Dec 8, 2010, 5:48:52 AM12/8/10
to

You're too self-confident and too eager to point out other's failings, as
you have just posted that my solution will fail which is incorrect.

I will admit that I [probably] don't know half as much as you about the
PC and less than 1/10 of what you know about composing command scripts for
the Window's Command Processor. But there's no excuse for over-confidence
in a rush to put other's down...

I already admitted that you showed me what I SHOULD have known about my
solution NOT being any good for commands that cannot be repeated - like
"delete" and "copy" operations. But I also already said that while I admit
that stupid over-sight, that my "nested two-batch script" solution would be
fine in billions more other cases.

( That is why, incidentally, I suggested it in the first place - because
I employ the "repeat command" in batch scripts so to preview the redirected
results. Or to also save results of a command by repeating it for both
text-file and console output )

You were quite right to correct the major "hole" in my logic that I
thought my suggestion would be sufficient to answer the OP's query, when
clearly, in reality, it was only half a solution! But then, I resent your
apparent attitude that my humility at always giving way to your greater
knowledge is not enough for you, and you are already thinking of the next
crushing comments for me notwithstanding

Please, I just wish. you would give me the benefit of your knowledge
when dissecting my efforts to aid other's - instead of trying to play the
art-critic on my ass.

==

Cheers, Tim Meddick, Peckham, London. :-)


P.S. Of course my solution works as far as it goes (with commands that do
not change the output. i.e. ones that you can repeat twice in the same
script) It's too simple - write the command once, re-directed to text-file,
like the OP wanted, and then next in order to display the same output to
screen. Why would you say it "fails".


"Todd Vargo" <tlv...@sbcglobal.netz> wrote in message

news:idmip2$m9b$2...@news.albasani.net...

Ted Davis

unread,
Dec 8, 2010, 10:47:13 AM12/8/10
to
On Wed, 08 Dec 2010 10:48:52 +0000, Tim Meddick wrote:

> my "nested two-batch script" solution would be fine in billions more
> other cases.

I have given this considerable thought and have concluded that nearly all
such cases are better served by

call batch1 > dump.txt
type dump.txt

The only kinds of batch files that your process even works for are those
that don't actually do anything, just generate reports of static
situations. There is little point in repeating the overhead of
generating the report when the results already exist as a file. In fact,
if the report is of a dynamic situation, then repeating the program
doesn't necessarily generate the same report, so capturing (and
displaying) a single instance of the report is the only way to make the
display and the file match.

I find it helpful, and less embarrassing, when proposing a new algorithm,
to give it quite a bit of deep thought, especially of the limiting cases
and of possible damage it might cause, then to carefully explain the
limits and possible damage. If the algorithm is not already in use,
there may well be a good reason why. If 'the elders' find fault with it,
but don't give carefully thought out and detailed objections, their
reactions my be because it is simply wrong on so many levels that it
would take all day to work out and write the details, but that the
wrongness is clear as a gestalt to those with sufficient experience and
expertise. Your suggestion exhibits that type of wrongness.

--
Ted Davis (tda...@mst.edu)

Todd Vargo

unread,
Dec 8, 2010, 7:38:33 PM12/8/10
to

Right, but watch it or you will be next to be accused of being "too
self-confident and too eager to point out others failings."

Todd Vargo

unread,
Dec 8, 2010, 8:11:33 PM12/8/10
to

"Tim Meddick" <timme...@o2.co.uk> wrote in message
news:idnnr8$gnt$1...@speranza.aioe.org...

>
> You're too self-confident and too eager to point out other's failings, as
> you have just posted that my solution will fail which is incorrect.
>
> I will admit that I [probably] don't know half as much as you about the
> PC and less than 1/10 of what you know about composing command scripts for
> the Window's Command Processor. But there's no excuse for over-confidence
> in a rush to put other's down...
>
> I already admitted that you showed me what I SHOULD have known about my
> solution NOT being any good for commands that cannot be repeated - like
> "delete" and "copy" operations. But I also already said that while I
> admit that stupid over-sight, that my "nested two-batch script" solution
> would be fine in billions more other cases.
>
> ( That is why, incidentally, I suggested it in the first place - because
> I employ the "repeat command" in batch scripts so to preview the
> redirected results. Or to also save results of a command by repeating it
> for both text-file and console output )
>
> You were quite right to correct the major "hole" in my logic that I
> thought my suggestion would be sufficient to answer the OP's query, when
> clearly, in reality, it was only half a solution! But then,

Actually, foxydrive pointed it out. I just elaberated on it because he did
not explain and you continued to defend your mistake.


> I resent your apparent attitude that my humility at always giving way to
> your greater knowledge is not enough for you, and you are already thinking
> of the next crushing comments for me notwithstanding
>
> Please, I just wish. you would give me the benefit of your knowledge
> when dissecting my efforts to aid other's - instead of trying to play the
> art-critic on my ass.

I am not here to point out anyones errors. However, when an error is made,
it is important for anyone who spots it to point it out so others reading it
wont falling into the same mistakes. For the record, I am not the one
comparing who knows more, nor do I sit here waiting for you to post just to
respond. If you continue with these personal attacks, I'm sending you back
to the twit filter again.

>
> ==
>
> Cheers, Tim Meddick, Peckham, London. :-)
>
>
> P.S. Of course my solution works as far as it goes (with commands that do
> not change the output. i.e. ones that you can repeat twice in the same
> script) It's too simple - write the command once, re-directed to
> text-file, like the OP wanted, and then next in order to display the same
> output to screen. Why would you say it "fails".

We both know that all you are going to do is dispute what has already been
explained. It's a pointless discussion so let's just agree to disagree and
move on.

Tim Meddick

unread,
Dec 9, 2010, 6:18:55 AM12/9/10
to
I am only defending my position...

But I would straight-away admit any failings of mine, and be grateful of
it.

But also, will always take exception to unwarranted put-downs when people
abandon politeness and common decency.

I think sometimes people here forget that the posts are originating from
actual human-beings!

==

Cheers, Tim Meddick, Peckham, London. :-)


"Todd Vargo" <tlv...@sbcglobal.netz> wrote in message

news:idp8e5$i2e$1...@news.albasani.net...

foxidrive

unread,
Dec 9, 2010, 6:47:15 AM12/9/10
to
On 9/12/2010 22:18, Tim Meddick wrote:

> But I would straight-away admit any failings of mine, and be grateful of
> it.

Oh yeah?


--
Regards,
Mic

Timo Salmi

unread,
Dec 9, 2010, 10:40:07 AM12/9/10
to
On 09.12.2010 13:18 Tim Meddick wrote:
> I think sometimes people here forget that the posts are originating from
> actual human-beings!

That's only human.

All the best, Timo (aka Perfesser Pundit in news:rec.humor)

--
Prof. Timo Salmi mailto:t...@uwasa.fi ftp & http://garbo.uwasa.fi/
Hpage http://www.uwasa.fi/laskentatoimi/english/personnel/salmitimo/
Department of Accounting and Finance, University of Vaasa, Finland
Perfesser's nauseating puns: ftp://garbo.uwasa.fi/pc/ts/tspun23.zip

FileGod

unread,
Dec 9, 2010, 2:50:47 PM12/9/10
to
"Todd Vargo" <tlv...@sbcglobal.netz> wrote:
>What would be the point to create yet another website that people wont read
>because they don't know the right questions or terminology to input into a
>search engine? Prof. Timo already posts a weekly FAQ which leads to his site
>which contains links to many existing sites that for whatever reason, people
>are just not finding their answers prior to posting.

I bet if there was a it counter on Timo's sites they would show a large
number of hits, I have no idea how many times I myself have been there
or eve Richard Bonners site, I even ended up on Richard's site today.
I am sure I would not be the only one that would check out your site
if you started one.
Shoot, I need to put some more hit counters on on my site, I will
get back to work on it after I get my main computer back up, I still
have errors on it like one of the search scripts need work, the space
being used by the wallpaper could be used for better stuff such as
source code...
Have a good one Todd.

http://www.filegod.netfirms.com

Tim Meddick

unread,
Dec 9, 2010, 5:59:46 PM12/9/10
to
Hello Timo!

What do you think about batch-file compilers?

(e.g. BAT2EXEC.COM & BATLITE.EXE)

==

Cheers, Tim Meddick, Peckham, London. :-)


"Timo Salmi" <t...@uwasa.fi> wrote in message
news:4d00f856$0$14455$9b53...@news.fv.fi...

Timo Salmi

unread,
Dec 9, 2010, 6:17:22 PM12/9/10
to
In article <idrn19$a4r$1...@speranza.aioe.org>,

Tim Meddick <timme...@o2.co.uk> wrote:
> Hello Timo!
> What do you think about batch-file compilers?
> (e.g. BAT2EXEC.COM & BATLITE.EXE)

I, among others, consider batch file compiling useless.

All the best, Timo

--
Prof. Timo Salmi mailto:t...@uwasa.fi ftp & http://garbo.uwasa.fi/
Hpage: http://www.uwasa.fi/laskentatoimi/english/personnel/salmitimo/
Department of Accounting and Finance, University of Vaasa, Finland

Useful CMD script tricks http://www.netikka.net/tsneti/info/tscmd.php

Todd Vargo

unread,
Dec 9, 2010, 11:35:03 PM12/9/10
to
Timo Salmi wrote:
> Tim Meddick <timme...@o2.co.uk> wrote:
>> Hello Timo!
>> What do you think about batch-file compilers?
>> (e.g. BAT2EXEC.COM & BATLITE.EXE)
>
> I, among others, consider batch file compiling useless.

Why is he asking this question on this thread?
Ever hear of the term "thread hijacking"? It seems to be his forte.

Todd Vargo

unread,
Dec 9, 2010, 11:07:19 PM12/9/10
to
FileGod wrote:

Unfortunately, hit counters do not tell you what a visitor was actually
looking for, or if they found it. More interesting would be to know if a
poster of a FAQ actually looked on Timo's site when they claim to have done
extensive searching for the past hour (that's laughable). Those posters
almost always are looking for a handout rather than put forth real effort to
learn something about their subject.

Tim Meddick

unread,
Dec 10, 2010, 12:24:01 AM12/10/10
to
Who the bloody hell do you think you're talking to?

I don't know which one of your little friends your weak attempt at trying
to talk down to people as if they're not going to be taking part in a
thread that they posted to, is trying to impress...

You're talking out of your ass when you say I'm known to "hijack" other
people's threads.

If you actually bothered to read back though this thread (if you can't
read, get one of your little friends to read it to you) you'd see that I
have been taking part - then Prof. Timo Salmi posted a comment addressed at
me - to which I responded!

AND THAT IS ALL I DID!

Your an idiot for having a go at me!

I'm normally a quiet guy, and really try to take other's feelings into
account and rarely criticize.

But when some arrogant turd such as you, takes it upon himself to try and
intimidate and bully me, I take exception....

Just keep your bloody nose out of what is none of your business.

==

Cheers, Tim Meddick, Peckham, London. :-)

"Todd Vargo" <tlv...@sbcglobal.netz> wrote in message

news:idsamc$ln$2...@news.albasani.net...

foxidrive

unread,
Dec 10, 2010, 1:15:54 AM12/10/10
to
On 10/12/2010 16:24, Tim Meddick wrote:

> But when some arrogant turd such as you

I wonder if Tim has looked in the mirror lately?

Who was it that came here and loudly proclaimed that he was going to top
post 'because other groups did it' and ignored the advice to follow the
conventions of the group?

Tim, Tim, Tim.

--
Regards,
Mic

billious

unread,
Dec 10, 2010, 3:30:51 AM12/10/10
to

"Todd Vargo" <tlv...@sbcglobal.netz> wrote in message
news:idsamc$ln$1...@news.albasani.net...

> FileGod wrote:
>
> Unfortunately, hit counters do not tell you what a visitor was actually
> looking for, or if they found it. More interesting would be to know if a
> poster of a FAQ actually looked on Timo's site when they claim to have
> done extensive searching for the past hour (that's laughable). Those
> posters almost always are looking for a handout rather than put forth real
> effort to learn something about their subject.

Consider this, Todd:

The people who ask here are the ones who have the wit to ask questions. They
are the ones who are considered in today's world to have researched the
matter....


Tim Meddick

unread,
Dec 10, 2010, 3:49:19 AM12/10/10
to
You're another one - just get on board the band-wagon!

What has what you just wrote, got to do with anything?

Hypocrisy!

It's not *me* that's "hijacking" anything - but the "thirst" to try and
make some poor bugger (me) bleed that's driving all these "vultures" to
change the subject of topic!

Don't blame me for defending myself!

==

Cheers, Tim Meddick, Peckham, London. :-)

"foxidrive" <foxi...@gotcha.woohoo.invalid> wrote in message

news:xAjMo.7490$Wq1....@newsfe11.iad...

\Bushy

unread,
Dec 10, 2010, 3:55:12 AM12/10/10
to

Damn, this is starting to get good from an Aussie point of view! Heh
heh!
Hope you blokes keep it up. Way better entertainment on here in the
past week / fortnight than there is on tele...

Todd Vargo

unread,
Dec 10, 2010, 11:30:03 AM12/10/10
to

A moderated group would have solved the issue before it started. I belong to
a group where if the subject line is not properly formed, it goes into the
bin bucket without notification. Perhaps a prerequisite for posting to amb
could be to require reading Timo's FAQ material and then pass a quiz on it.
;)

Tim Meddick

unread,
Dec 10, 2010, 11:59:18 AM12/10/10
to
Well why don't you just fuck off there then?

==

Tim Meddick, Peckham, London. :-(


"Todd Vargo" <tlv...@sbcglobal.netz> wrote in message

news:idtki8$vnm$1...@news.albasani.net...

Tim Meddick

unread,
Dec 10, 2010, 12:10:57 PM12/10/10
to
To ALL :-

I DO APPOLOGISE FOR MY LAGUAGE.....

I do not think there's an excuse for it, and whereas, I know that I have no
obligation to say sorry for it, I do want people to know I regret it.

I let someone get under my skin again, and I really should know better. I
feel he doesn't let go and pursues me for the most trivial of matters which
he builds upon.

It's no exaggeration to say I feel victimised by him and some others seem
to enjoy the same as some category of sport for their amusement.

To Todd V -

Seriously - leave me alone man - you don't see me going after other people,
and you may claim you don't, but here we are again.

Can you simply not resist thinking you must answer my posts?

Do I represent that great a threat to you that you feel you have to answer
every single piece of rhetoric I utter?

Seriously - leave me alone man!

FileGod

unread,
Dec 10, 2010, 10:12:55 PM12/10/10
to
"Todd Vargo" <tlv...@sbcglobal.netz> wrote:
>Those posters almost always are looking for a handout rather than
>put forth real effort to learn something about their subject.

Those are the type that most of the time do not say thanks after
someone does a complete working script, I was very happy to see all
the more stuff added to the command interpreter for Win NT/XP, shoot
I do not even use my old DOS programs anymore I did in Basic, I have
been practicing Basic a little just so I do not forget everything.
Right now I am playing with C++ & getting a collection of source
that works, My batch file for C++ compilers handle 3 compilers so
far.


xanad...@gmail.com

unread,
Feb 18, 2014, 2:55:36 PM2/18/14
to
On Saturday, December 4, 2010 4:51:44 AM UTC-5, foxidrive wrote:
> On 4/12/2010 20:25, techman41973 wrote:
> > I know you can pipe the output of a batch file to a text file
> > such as launch.bag> log_file.txt
> > but this turns off the output on the screen.
> > Is there a way to keep the output on the screen AND write the output
> > to a text file?
>
> Use a TEE filter.
>
> --
> Regards,
> Mic

T is a wonderful thing.
And I wish we were a UNIX world again but
I use Tail.
I output the batch to a file batch > file.txt
Then run tail on the file.
Easy Peasy.
Steph :D

foxidrive

unread,
Feb 18, 2014, 10:31:20 PM2/18/14
to
This batch TEE filter was written by Dave Benham



::batchTee.bat OutputFile [+]
::
:: Write each line of stdin to both stdout and outputFile.
:: The default behavior is to overwrite any existing outputFile.
:: If the 2nd argument is + then the content is appended to any existing
:: outputFile.
::
:: Limitations:
::
:: 1) Lines are limited to ~1000 bytes. The exact maximum line length varies
:: depending on the line number. The SET /P command is limited to reading
:: 1021 bytes per line, and each line is prefixed with the line number when
:: it is read.
::
:: 2) Trailing control characters are stripped from each line.
::
:: 3) Lines will not appear on the console until a newline is issued, or
:: when the input is exhaused. This can be a problem if the left side of
:: the pipe issues a prompt and then waits for user input on the same line.
:: The prompt will not appear until after the input is provided.
::
:: 4) Attempting to abort the piped commands will lock up the console. Ouch!
::

@echo off
if "%~1" equ ":tee" goto :tee

setlocal disableDelayedExpansion
:lock
set "teeTemp=%temp%\tee%time::=_%"
2>nul (
9>"%teeTemp%.lock" (
(find /n /v ""&echo END) >"%teeTemp%.tmp" | <"%teeTemp%.tmp" "%~f0" :tee %*
(call )
) || goto :lock
)
del "%teeTemp%.lock" "%teeTemp%.tmp"
exit /b

:tee
setlocal enableDelayedExpansion
set "redirect=>"
if "%~3" equ "+" set "redirect=>>"
8%redirect% %2 (
for /l %%. in () do (
set "ln="
set /p "ln="
if defined ln (
if "!ln:~0,3!" equ "END" exit
set "ln=!ln:*]=!"
(echo(!ln!)
(echo(!ln!)>&8
)
)
)


Tim Meddick

unread,
Feb 19, 2014, 4:32:12 AM2/19/14
to
Wouldn't this work;

launch.bag> log_file.txt &type log_file.txt


.......?

==

Cheers, Tim Meddick, Peckham, London. :-)




<xanad...@gmail.com> wrote in message
news:96a846d3-1afb-4f37...@googlegroups.com...

kennet...@gmail.com

unread,
Apr 17, 2014, 6:24:02 PM4/17/14
to
Yep.

Nice!


On Wednesday, February 19, 2014 2:32:12 AM UTC-7, Tim Meddick wrote:
> Wouldn't this work;
>
>
>
> launch.bag> log_file.txt &type log_file.txt
>
>
>
>
>
> .......?
>
>
>
> ==
>
>
>
> Cheers, Tim Meddick, Peckham, London. :-)
>
>
>
>
>
>
>
>
>
>

robtc...@gmail.com

unread,
Mar 30, 2015, 12:27:07 PM3/30/15
to
On Saturday, December 4, 2010 at 4:25:41 AM UTC-5, techman41973 wrote:
> I know you can pipe the output of a batch file to a text file
> such as launch.bag > log_file.txt
> but this turns off the output on the screen.
> Is there a way to keep the output on the screen AND write the output
> to a text file?
> I searched the archive of this newsgroup and did a google web search
> and can't find a conclusive answer to this question.

I know this is a very old post but, having just wrestled with this myself I thought I'd add a little something - a variation of Tim Meddick's 2/19/14 post:

echo I want to see this on-screen and logged > TempLog.txt &type TempLog.txt &type TempLog.txt >> RealLog.txt

The issue with the original was that it stomped log_file.txt on every write. If the batch file has multiple logging points, you'll want to avoid that. The line above does this by putting the contents of the temp log file on the screen and then appending it to the 'real' log file. On the next pass, the temp file is overwritten (so you only see the current message) and is added to the master log so you have historical info.

FWIW

Robert

Timo Salmi

unread,
Apr 1, 2015, 12:40:19 PM4/1/15
to
> On Saturday, December 4, 2010 at 4:25:41 AM UTC-5, techman41973 wrote:
>> I know you can pipe the output of a batch file to a text file
>> such as launch.bag > log_file.txt
>> but this turns off the output on the screen.
>> Is there a way to keep the output on the screen AND write the output
>> to a text file?
>> I searched the archive of this newsgroup and did a google web search
>> and can't find a conclusive answer to this question.

http://www.netikka.net/tsneti/info/tscmd094.htm

All the best, Timo

--
Prof. (emer.) Timo Salmi, Vaasa, Finland
http://www.netikka.net/tsneti/homepage.php
0 new messages