How do I search for and delete 0k files on a shared volume?

I've got a NAS device with a ton of 0kb files scattered all over it - is there a tool I can use to automatically delete any file on the NAS w/ a file size of 0k?

Searching using Windows' built-in search doesn't do it because, though it find the files, it tends to break as I attempt to delete all of the results.
Who is Participating?
ChrisJScottConnect With a Mentor Author Commented:
Found a great way to do it via UNIX (Mac OS X) - with the volume mounted, use:

find . -size 0k -exec rm -rf {}\:
Write this in notepad and save it with a .cmd extension.
Change "C:\MyFolder" to your path to the NAS

FOR /R "C:\MyFolder" %%F IN (*.*) DO (
       IF "%%~zF" GTR "0" (DEL /F %%F))
EXIT /B /0
ChrisJScottAuthor Commented:
(went off and figured this one out on my own; posting for others)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.