Solved

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

Posted on 2010-11-18
3
346 Views
Last Modified: 2012-05-10
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.
0
Comment
Question by:ChrisJScott
  • 2
3 Comments
 
LVL 13

Expert Comment

by:Rick
Comment Utility
Write this in notepad and save it with a .cmd extension.
Change "C:\MyFolder" to your path to the NAS

@ECHO OFF
FOR /R "C:\MyFolder" %%F IN (*.*) DO (
       IF "%%~zF" GTR "0" (DEL /F %%F))
EXIT /B /0
0
 

Accepted Solution

by:
ChrisJScott earned 0 total points
Comment Utility
Found a great way to do it via UNIX (Mac OS X) - with the volume mounted, use:

find . -size 0k -exec rm -rf {}\:
0
 

Author Closing Comment

by:ChrisJScott
Comment Utility
(went off and figured this one out on my own; posting for others)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

A few months ago I had an issue with LaserJet 1020 printer which was installed to XP and Windows 7.  It was installed to XP and working, but when I tried to connect from a Windows 7 PC, it would attempt connection and then fail.  Sometimes the Spool…
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now