So I was going through my photos folder on my computer, and organizing things by when I took the photos. And I noticed a bunch of hidden thumbnail cache files for a program I no longer used. Now, rather than go through and delete these by hand, I decided to simply “simply” open up command prompt and delete all of them at once.

So I fire up command prompt and goto my photos directory and run the following command, which, I thought would work perfectly…

1
DIR /S /A:H | FIND /I "Zb" | DEL

It’s pretty simple, take a directory listing of hidden files in all subdirectories, pipe that into a find to search for the “Zb” in the file name, and pipe the output into a delete command.

Wrong.

I apparently can’t do that with DOS. And I had to write a batch file to do it:

1
2
3
4
5
@echo off
DIR /S /A:H /B D:\Photos\ >> temp.txt
echo Y | FOR /F "tokens=1, * delims=: " %%j in (temp.txt) do del "%%j:%%k"
echo Y | DEL temp.txt
exit

Yay for batch files :(