i don't know if anyone here has ever used the DELOLDER script found on
http://www.ss64.com/ntsyntax/, but basically it deletes all files older than a certain number of days. for example:
C:\> DELOLDER 90 "C:\TEMP\*"
will delete anything in C:\TEMP older than 90 days old. this works on every server we have except for one and i can't figure out why.
i've narrowed down the problem to one line. here's what happens when i set the echo on for that line. my file variable seems to get lost.
---*---*---*---*---*---*---*---*---*---*---*---*---*---*---*---*---*---*---
SERVER_A (BAD)C:\ORAMAINT>delolder 120 "C:\test\*"
FOR /f "tokens=*" %G IN ('XCOPY "c:\test\*" /D:03-08-2006 /L | FIND "\"') DO IF """=="%G" (GOTO :eof)---*---*---*---*---*---*---*---*---*---*---*---*---*---*---*---*---*---*---
SERVER_B (GOOD)C:\ORAMAINT>delolder 120 "C:\test\*"
FOR /f "tokens=*" %G IN ('XCOPY "C:\test\*" /D:03-08-2006 /L | FIND "\"') DO IF "C:\test\poop.txt"=="%G" (GOTO :eof)---*---*---*---*---*---*---*---*---*---*---*---*---*---*---*---*---*---*---
both servers are windows 2003. there's got to be some setting or something that i'm missing, but i think i'm staring at it too hard.
the scripts are in a zip file here:
http://www.ss64.com/ntsyntax/delolder.zip