1.

Solve : batch file output to text file?

Answer»

I have been searching for 30 minutes and I can't believe I haven't found an answer YET. MAYBE I have and just don't know it. How do I OUTPUT the entire contents of a batch file to a text file? Is the only way to use the ">" command at the end of each command? Thanksa batch file is a text file, therefore its contents are already in a text file.
I didn't word my question carefully enough. I want to redirect the entire output of a batch file to a text file. Sorry for the confusion. call the batch file thus

mybatch.bat > textfile.txt
I want want the code to be internal to the batch file. I will not be using the command line to run the batch file. Ah. I see. Cannot be done. Only way is to end each line with > (txtfile)

Or duplicate lines - one for screen and one for file.
Code: [Select]@echo off
@(
echo.txt1
echo.txt2
)>a.txt
for /F "tokens=* delims= " %%F in (a.txt) do echo %%F
pause >nuli dunno what you want to do but i think i understand itQuote from: devcom on July 30, 2008, 09:34:10 AM

i dunno what you want to do but i think i understand it

I don't think you do.

Quote from: mern1
I want to redirect the entire output of a batch file to a text file.

Quote from: mern1
I want the code to be internal to the batch file.


Discussion

No Comment Found