1.

Solve : Batch programing: output to file?

Answer»

Hi everyone =)

I have a simple problem, but I can't find a thing to solve it =(
So, I wrote a program, that writes thing out (ex.: with @echo) to the screen, but I'd like to get all the messages in a file too, or just to a file.

Is there a command, or something that tells the program to write everything into a file globally ?yes, its ACTUALLY quite simple, uses > for the first line, >> for the rest:

CODE: [SELECT]echo Hello there > file.txt
echo This is >> file.txt
echo A test >> file.txt
and the output:

File.txt
Code: [Select]Hello There
This is
A testum, well ...
Maybe I took the question wrong.

LETS assume that I have this code:
Code: [Select]echo Hello there
echo This is
echo A test
The program writes the strings out to the screen, but I'd like to cut/copy them into a file, like

Code: [Select]"I don't know" ~setoutput to > output.txt

echo Hello there
echo This is
echo A test

And because of the first line, all the output goes into that file.
Any idea?(1)

test.bat

Code: [Select]echo Hello there
echo This is
echo A test
(2)

Command line

test.bat > test.txt

(3)

test.txt

Code: [Select]Hello there
This is
A testLOL, yap, it was quite simple, but, maybe it was too simple for me D:

THX the solution a LOT anyway =)



Discussion

No Comment Found