[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2010-11-18
3
Medium Priority
?
375 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 13

Expert Comment

by:Rick
ID: 34167389
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
ID: 34372802
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
ID: 34399194
(went off and figured this one out on my own; posting for others)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When asking a question in a forum or creating documentation, screenshots are vital tools that can convey a lot more information and save you and your reader a lot of time
IF you are either unfamiliar with rootkits, or want to know more about them, read on ....
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

649 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