This code works fine. it deletes files from a file list:
For /f %%a in (file.lst) do del %%a
But why is the below one not working? It deletes the .lst
file itself:
if exist file.lst (
set filelist="file.lst"
) else (
set filelist="default.lst"
)
for /f %%b in (%filelist%) do del %%b
Also this is not working too:
for /f %%b in ("%filelist%") do del %%b
file.lst and default.lst contain something like this:
d:\1.txt
d:\2.txt
d:\abcd.bmp