Remove latest file .nfo .xml in a directory

August 13, 2011 at 12:22:52
Specs: Windows 7
I looked everywhere in the forums for an answer. I'm trying to set up XBMC, using Media Center Master that creates .nfo and .xml after processing a new file. I want to have a batch script that delete those files after they were created.

The way I was thinking of it would be to delete the 2 latest file added to the directory. My directory is as follow D:\Movies\Title\.nfo and .xml. I would place the script inside the "movies" folder so I would like for it to look at the 2 latest files added regarless of if they are in the movies folder or the subfolders (recursive).

Thank you :)

Oops, I forgot to mention that the recent why I was thinking of going with the 2 last file added was because I have another program that creates .nfo files and I don't want to delete those! The script will be attached to MCM as a post-processing script.



See More: Remove latest file .nfo .xml in a directory

Report •

#1
August 13, 2011 at 12:29:03
Oops, I forgot to mention that the recent why I was thinking of going with the 2 last file added was because I have another program that creates .nfo files and I don't want to delete those! The script will be attached to MCM as a post-processing script.

Report •

#2
August 18, 2011 at 06:57:09
NVM, I figured it out. I just realised in Media Center Master that you could simply put a parameter to keep it within the folder it's working. Simply use the %F parameter and create a .cmd with the line del *.xml and or del *nfo.

Report •
Related Solutions


Ask Question