troubleshooting Question

FORFILES doesn't seem to delete files in folder

Avatar of Alan OBrien
Alan OBrienFlag for Ireland asked on
Windows Server 2003Scripting LanguagesWindows Batch
6 Comments1 Solution1264 ViewsLast Modified:
Hi All,

I have a forfiles batch which i run on a server to delete files older than 21 days in a network folder. The script completes ok but the files dont seem to delete.

forfiles /p "Z:\servername" /d -21 /c "cmd /c echo y> del @path

What am i missing?

"Batchelor", Developer and EE Topic Advisor
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros