Delete file with name and path in another .bat file

0

I need to develop a batch that has to read the data in a .txt file, and according to the path and filename I have in txt the batch has to go to the folder and delete files.

The data I have in this file is the result of an sql query. To exemplify what I said:

file_name, file_path
abcd, D:/user/desktop/teste123
efgh, D:/user/desktop/folder789

My batch needs to read file_name (to know what to delete) and file_path (to know where to delete).

    
asked by anonymous 09.11.2018 / 00:12

1 answer

0

Using FOR /F

@echo off
for /f "skip=1 tokens=1,2 delims=," %%a in (in.txt) do echo del "%%b/%%a"
Pause

I put a echo in front of del so you can test the output. You can remove if this is ok

    
10.11.2018 / 00:31