?
Solved

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

Posted on 2010-11-18
3
Medium Priority
?
370 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

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
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
Suggested Courses

762 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