none
How can I delete an undeletable diretory? (Access Denied, Max Path Len)

    Question

  • I naively did this:

    robocopy c:\Users D:\MIGRATION_BACKUP\Users /mir /mt /zb

    It failed and I found a better way to backup Users. But I'm left with an undeleteable directory in D:\backup\users:

    D:\MIGRATION_BACKUP\Users\All Users\Application Data\Application Data\Applicatio
    n Data\Application Data\Application Data\Application Data\Application Data\Appli
    cation Data\Application Data\Application Data\Application Data\Application Data\
    Application Data>dir /ah
     Volume in drive D is D_Drive
     Volume Serial Number is 3AC6-ACF4

     Directory of D:\MIGRATION_BACKUP\Users\All Users\Application Data\Application D
    ata\Application Data\Application Data\Application Data\Application Data\Applicat
    ion Data\Application Data\Application Data\Application Data\Application Data\App
    lication Data\Application Data

    08/19/2013  09:17 PM    <DIR>          .
    08/19/2013  09:17 PM    <DIR>          ..
    08/19/2013  09:17 PM    <DIR>          Application Data
                   0 File(s)              0 bytes
                   3 Dir(s)  650,405,253,120 bytes free

    D:\MIGRATION_BACKUP\Users\All Users\Application Data\Application Data\Applicatio
    n Data\Application Data\Application Data\Application Data\Application Data\Appli
    cation Data\Application Data\Application Data\Application Data\Application Data\
    Application Data>cd "Application Data"
    The filename or extension is too long.

    Here is what I've tried:

    - If I view that directory in Windows Explorer (as Administrator), there are no files or subdirectories, even if I turn on Hidden Files.

    - Right-click delete of Users (again as Admin) says it can't delete some files/folders because name is too long.

    - rd /s (as Admin) gives "The system cannot find the path specified"

    - Tried cding all the way to the bottom subdir in cmd and rd /s of the last subdir - same problem

    - Same thing using the 8.3 name ("APPLIC~1" in the bottom subdir)

    Any other ideas on how I can clean this up?



    Tuesday, August 20, 2013 3:48 PM

Answers

  • You can use alternative file manager Total Commander which supports very long file names. Just make sure to un-check Configuration > Options > Copy/Delete > Use Explorer delete method.

    I believe they have a free or demo version you can use, if it won't delete I think you can rename the file were explorer can delete.

    Thursday, August 22, 2013 2:25 AM

All replies