I am trying to write a batch script to delete files listed in in a text file. I have it working fine (have never written a batch script). The problem is, I can't seem to figure out how to write it using relative paths so that it can be run on a different computer from the root directory.
The batch script I have is:
for /f "delims=" %%f in (List_of_Files.txt) do del "%%f"
The list of files is structured like this:
payroll_page\cf2_2.gif
payroll_page\chart_e.gif
payroll_page\dollar-06.gif
payroll_page\calendar_files\image001.png
What I want to do is to be able to run this batch file from a root directory of the folder structure and delete the files in the subdirectories that are listed. Any help at all with this would be great as I've been banging my head against it for hours.
In the simplest case: as your text file lines have relative paths then the batch file has to be executed from the relative folder in question.
If your text file has fully qualified paths names then it can be launched from anywhere.