• Status: Solved
  • Priority: High
  • Security: Public
  • Views: 38
  • Last Modified:

Cannot Delete Directories on External USB after Robocopy

I'm sure this is a simple fix (I HOPE), but I just can't figure it out.

I have a Windows 2012 servcer here, latest patches and updates. I ran the following commands to copy local drives to an external USB 5T dsk:
robocopy C:\ G:\APOLLO2\C-DRIVE /mir /copyall /dcopy:T /R:1 /W:5 /MT:8 /ZB /log:"c:\Robocopy-C.log" /tee
robocopy D:\ G:\APOLLO2\D-DRIVE /mir /copyall /dcopy:T /R:1 /W:5 /MT:8 /ZB /log:"d:\Robocopy-D.log" /tee
robocopy E:\ G:\APOLLO2\E-DRIVE /mir /copyall /dcopy:T /R:1 /W:5 /MT:8 /ZB /log:"e:\Robocopy-E.log" /tee

Now I want to clean up everything in G:\APOLLO2 and remove it....however anytime I try to use rd /s or del /s I'm seeing.

G:\APOLLO2>rd /s /q C-DRIVE
C-DRIVE\SYSTEM~1\REMOTE~1 - Access is denied.
C-DRIVE\SYSTEM~1\SRM - Access is denied.

.Trash-0\expunged\133334~1\APPLIC~1\APPLIC~1\APPLIC~1\APPLIC~1\APPLIC~1\APPLIC~\APPLIC~1\MICROS~1\WINDOW~1\MSScan\WelcomeScan.jpg - Access is denied.
.Trash-0\expunged\133334~1\APPLIC~1\APPLIC~1\APPLIC~1\APPLIC~1\APPLIC~1\APPLIC~\APPLIC~1\PACKAG~1\{743FC~1.231\packages\VISUAL~1 - The directory is not empty.

Permissions are for Administrators FULL and Also owned by Administrators - Its the only ID on the box.

I'm at a loss - I REALLY don't want to format the disk there's 3+ TB Of other data I needed out there.

Thanks in advance.
0
George R. Kasica
Asked:
George R. Kasica
  • 2
1 Solution
 
Travis MartinezSmoke JumperCommented:
Try another robocopy to delete the folder by mirroring an empty one:

robocopy C:\Temp G:\APOLLO2\C-DRIVE\SYSTEM~1\ /MIR /R:3 /MT:8

That should clear out the directory, quickly and leave just the root to be removed.
0
 
George R. KasicaSr. Systems AdministratorAuthor Commented:
Thank you very much. What changes should I make to robocopy to avoid this in the future? Though now I have a “fix” in any case.
0
 
Travis MartinezSmoke JumperCommented:
To be fair brother I'm not sure which switch did it; however, the following "/copyall /dcopy:T" isn't needed because of the /MIR option.  It will copy/keep all of the file attributes without specifying those two you have in the command line.
1
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now