i have typed this in cmd: echo echo hello >> hello.txt >> hello.bat
so the batchfile script on hello.bat is this: echo hello >> hello.txt
and when you starting hello.bat it will make hello.txt
in hello.txt: hello
but....
when i typing echo echo hello >> hello.txt >> hello.bat today the hallo.bat has a script like this:
echo hello.
where is >> hello.txt ?
what is wrong??
echo >> hello.bat fail
Moderator: DosItHelp
Re: echo >> hello.bat fail
hi dani8190,
try it with escape characters
without the escape character cmd.exe find the first >> hello.txt and suppose to pipe into that file
but then cmd.exe found >> hello.bat, and it decides not to pipe to hello.txt, but to hello.bat
jeb
try it with escape characters
Code: Select all
echo echo hello ^>^> hello.txt >> hello.bat
without the escape character cmd.exe find the first >> hello.txt and suppose to pipe into that file
but then cmd.exe found >> hello.bat, and it decides not to pipe to hello.txt, but to hello.bat
jeb
Re: echo >> hello.bat fail
or
Code: Select all
for %%a in (
"echo hello >> hello.txt"
) do echo %%~a >> hello.bat