troubleshooting Question

Empty Directory Batch File

Avatar of mrsam3
mrsam3 asked on
Microsoft DOS
7 Comments1 Solution587 ViewsLast Modified:
I created the following batch file to search for empty directories and then email them to me.

@echo off
for %%A in (c:\*.txt) do if %%~zA==0 Blat -to -f -server webmail-subject "Zero byte file" -body "%%A is 0 bytes test 2"

Here is the command to run
for %A in (c:\*.txt) do if %%~zA==0 echo."%A" is empty

Now I need to make a batch file that will go into a directory that uses this convention.


So basically every day I am going to run this script and I want it to go into todays directory and look for any files that are 0 bytes.  If it finds one then It needs to email me.

Any suggestions?

Thanks in advance..

Farhan Kazi
Systems Engineer
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros