Append text to all files in a directory using batch -
i'm complete batch beginner..
i'm trying add 'exit' last line of every text file in folder.
i it's combination of , echo can't work after doing lot of searching.
my current attempt;
for %%i in (*.*) echo exit >> %cd% %%i
:(
any appreciated!
it if explained why think “can't work”; i'm guessing want:
for %%i in (*.txt) echo exit>> %%i
don't put space after text want echo
. don't know why have %cd%
in redirection; try send text local directory, makes no sense. if you're trying send file in different directory need separate them window’s directory separator:
... echo whatever>> \other\directory\%%i
you don't need %cd%
Comments
Post a Comment