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

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -