How to write batch file input to text file?

Microsoft Microsoft windows xp pro full...
January 6, 2010 at 11:25:32
Specs: Windows XP, 2.4 3GB
If I have:
set /p filename=What is your filename?:
echo You have entered: %filename%
echo %filename% > C:\mytest\output.txt
... How do I take the user input and append to output.txt (not overwriting text in the file already)?

See More: How to write batch file input to text file?

Report •


#1
January 6, 2010 at 12:12:21
echo %filename% >> C:\mytest\output.txt

oops, yeah, i forgot take the space out.
echo %filename%>>C:\mytest\output.txt

the "inverted" version is better but i haven't
yet been able to make it a habit:
>>C:\mytest\output.txt echo %filename%


Report •

#2
January 6, 2010 at 12:23:48
@echo off & setLocal EnableDELAYedeXpansion

set /p filename=What is your filename?:
>> namelist.txt echo !filename!
> output.txt echo !filename!


=====================================
Helping others achieve escape felicity

M2


Report •

Related Solutions


Ask Question