-1

So i have this batch file that needs to delete a word in a txt file. it needs to delete the "addons" word at the end of this directory: D:\Batch Files\files\addons

1
  • 2
    Show us the batch-file, we won't write the whole code for you Commented Nov 28, 2015 at 20:24

1 Answer 1

0

This should work. It will create a new file though.

@echo off setlocal enabledelayedexpansion FOR /F "usebackq delims=" %%G IN ("Test.txt") DO ( Set "line=%%G" & echo !line:Pie=! )>>"Test2.txt 
Sign up to request clarification or add additional context in comments.

1 Comment

you append to the same file, you are reading from. So it doubles your data. Better write to a new file (you can rename it afterwards, overwriting the original file, if needed)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.