Windows: in batch file, write multiple lines to text file? -
how can following in windows batch file?
- write file called subdir/localsettings.py
- overwrite existing content...
- ...with multiple lines of text...
- ...including string "[current working directory]/subdir" (which think might
%cd%/subdir
?)
please note, want part of batch script can't use con
+ enter (at least, maybe can, don't know how simulate enter part of batch script).
thanks!
use output redirection >
, >>
echo one>%file% echo two>>%file% echo three>>%file%
or in more readable way: (in cmd.exe
, using "echo 1 >%file%
" include whitespace before >
.)
>%file% echo 1 >>%file% echo 2 >>%file% echo 3
you use:
( echo 1 echo 2 echo 3 ) >%file%
Comments
Post a Comment