Windows: in batch file, write multiple lines to text file? -


how can following in windows batch file?

  1. write file called subdir/localsettings.py
  2. overwrite existing content...
  3. ...with multiple lines of text...
  4. ...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

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -