forfiles.exe scripting

Posted by PHLiGHT on Super User See other posts from Super User or by PHLiGHT
Published on 2011-01-05T16:25:24Z Indexed on 2011/01/05 16:55 UTC
Read the original article Hit count: 227

Filed under:
|
|
|

I'm looking to automatically delete files older than 7 days old with forfiles. The code below works when I manually do it it and respond yes to deleting the files. How can I incorporate the yes into this?

This is the output

E:\Documents and Settings\Administrator>forfiles -p "H:\SHARED\Sca ns" -s -m . -d -7 -c "cmd /c del @path" Could Not Find H:\SHARED\Scans.DS_Store H:\SHARED\Scans\XXX\DOC006.XSM*, Are you sure (Y/N)?

© Super User or respective owner

Related posts about Windows

Related posts about script