View Single Post
Old 03-26-2007, 12:01 PM   #1 (permalink)
Bratwurst
Insane
 
Bratwurst's Avatar
 
Location: La la land
Batch File - delete everything not modified in x days

I'm looking to do exactly what the title says via a batch file. I'd like to schedule this to run weekly on my FTP server.

I've tested this extremely simple line in a batch file:

del *.* /s /q

(delete all files, in all subdirectories, in quiet mode)

Although it says to delete *.*, it doesn't delete my folder directory structure, which is good because I have an FTP server with roughly 100 virtual ftp directories.

What I need to figure out is how to specify to only delete files that have not been modified in x amount of days. X will probably equal 14.

I'm currently trying to read some of the documentation I found on M$'s site, but I'm not having much luck understanding this stuff. Does anyone know how to do this? I'm not looking for a quick out, I'm trying to learn as well so an explanation of how the switches work, or just a link to a better tutorial to learn how to write these scripts myself would be GREATLY appreciated!

Thanks
__________________
40
Bratwurst is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73