You need /MOVE see below. /MOV only does files. /MOVE does files and directories:
/MOV Moves files (that is, deletes source files after copying). /MOVE Moves files and directories (that is, deletes source files and directories after copying). Chris Bodnar, MCSE Sr. Systems Engineer Infrastructure Service Delivery Distributed Systems Service Delivery - Intel Services Guardian Life Insurance Company of America Email: christopher_bod...@glic.com Phone: 610-807-6459 Fax: 610-807-6003 _____ From: gregfar...@gmail.com [mailto:gregfar...@gmail.com] Sent: Thursday, January 28, 2010 2:52 PM To: NT System Admin Issues Subject: robocopy script - deleting aged folders I have a ROBOCOPY batch file question please: C:\Parcams is a directory that accumulates dated security camera snapshots. The snapshots for each day are stored in a sub-directory, named after that date, i.e., C:\Parcams\parcams-12-30-2009 I have prepared a script for purging files and folders that are greater than "n" days old. However, I have not quite got the script right. It successfully deletes the files inside the dated directories, but it leaves the empty directories behind. pic: http://screencast.com/t/OWFlYmEy Here is the text of the script: mkdir c:\dump robocopy C:\PARCAMS C:\dump /E /MOV /MINAGE:60 /R:10 rmdir C:\dump /s /q Here is a screenshot of the results of the batch file: http://screencast.com/t/ZjMyMzVjN Any suggested tweaks? I'd like to have the script remove those empty directories too. Thanks! ~Greg ----------------------------------------- This message, and any attachments to it, may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are notified that any use, dissemination, distribution, copying, or communication of this message is strictly prohibited. If you have received this message in error, please notify the sender immediately by return e-mail and delete the message and any attachments. Thank you. ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~