Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.