Alan OBrien
asked on
FORFILES doesn't seem to delete files in folder
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?
Thanks
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?
Thanks
it seems u forgot a double quote, you have one before cmd but where's the closing one?
try:
forfiles /p "Z:\servername" /d -21 /c "cmd /c echo y> del @path"
you may also want /S to go down into subdirectories
ASKER
Thanks Segwick, i had just copied and pasted from the batch and didnt copy the double quote but i had it in there already
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Will try those out and let you know tomorrow. thanks.