I want to search and delete *.mp4 *.mpeg, *.mkv, *.flv, *.avi (all video files) from all drives (C,D,E,F) or anywhere in my computer in any directory or subdirectory, using BATCH File. My operatin system is windows XP.
I have no means to test this right now. Just run it and see, if it does everything right. Afterwards remove the
First of all, it could be quite dangerous to blindly delete files with a batch file because it would wipe out anything and everything. And while this is seemingly your goal, you have to be aware that it would also destroy files that are part of the operating system (Windows comes with a few videos here and there), as well as any programs and games that have video files. If your goal is to free up space, then there are better ways to do that (besides, not all videos are large).
Anyway, after my initial version magically stopped working for no apparent reason (yes, I tried to account for everything), I ended up using a work-around. The only draw-back to using
Instead of just blindly deleting everything, I made it so that it builds a secondary batch-file (
This version excludes system directories with a white-list, not a black-list, so instead of excluding directories you want to ignore, it adds the ones you want to scan (doing the other way around would be a little more complex and I can provide a script to do that if you need). I added