Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm looking for a modern (though not PowerShell) script to help me find zero byte files newer than say, 12 hours. The BAT scripts I'm finding on the web aren't working well. Server is Windows 2003 and I have tens of millions of directories to recurse. Thanks.

share|improve this question

1 Answer 1

Here's what you're looking for:

FOR /R c:\ %I in (*) do @echo %~dpznxI | find "0 c:" >> fileSizedump.txt
FOR /F "tokens=1,2* delims=:" %a in ('type fileSizedump.txt') DO if "%a"=="0 c" echo %a:%b >> fileSizeZero.txt

The first command dumps all files that have a 0 at the end of the file size and put it into the fileSizedump.txt file. The second one will weed out only the ones that have 0 for the file size and put those into the file fileSizeZero.txt.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.