Search found 4 matches

by ahwinnen
09 Oct 2013 12:28
Forum: DOS Batch Forum
Topic: Automatically deleting oldest directories
Replies: 13
Views: 12596

Re: Automatically deleting oldest directories

What if there is one directory that I want it to skip. Is there a way to exclude a directory before the "rd /s /q @path" ?
by ahwinnen
08 Oct 2013 08:55
Forum: DOS Batch Forum
Topic: Automatically deleting oldest directories
Replies: 13
Views: 12596

Re: Automatically deleting oldest directories

@echo off forfiles /p "G:\VERITAS\B2D" /d -5 /c "cmd /c if @isdir==TRUE rd /s /q @path" ^^ This will delete folders inside the B2D directory, not the directory itself, correct? I'll do a backup and test it when I get to work, just wanted to make sure. And I don't mind throwing a...
by ahwinnen
07 Oct 2013 12:08
Forum: DOS Batch Forum
Topic: Automatically deleting oldest directories
Replies: 13
Views: 12596

Re: Automatically deleting oldest directories

Oh yeah, I didn't think of that. I'll try it, thanks.
by ahwinnen
07 Oct 2013 07:25
Forum: DOS Batch Forum
Topic: Automatically deleting oldest directories
Replies: 13
Views: 12596

Automatically deleting oldest directories

For quite a while I've been using a batch file to delete old backup files. I've normally used forfiles to find all files older than 5 days. The code usually looks something like this: @echo off forfiles /p "G:\VERITAS\B2D" /m "*.bkf" /d -5 /c "cmd /c del @path" Now, I h...