Can Not Delete Directory ("The directory name is invalid")

  1. claytoncarney's Avatar
    Posts : 53
    Windows 10 Home 64-Bit
       #1

    Can Not Delete Directory ("The directory name is invalid")


    I have a WD My Passport USB drive, which I use with my WD TV Live Plus media player. As best I can determine, the media player has corrupted some of the file entries on the drive. It appears to have somehow changed the NTFS MFT data such that these files are instead being reported as directories.

    When I attempt to delete these "directories", I receive a "The directory name is invalid" error. The "directory" name is in fact valid and just to be sure, I've renamed the entries several times with simple names (test, corrupt, etc.). They still cannot be deleted.

    Here's what I've done over the last six hours trying to fix this problem:

    • chkdsk /f /r - no problems found
    • reinstalled device drivers
    • mounted drive from ubuntu. "directories" show size corresponding to the files, but have a directory attribute. can not delete - permission error.
    • tried numerous utilities (wise force delete, delete doctor, file assassin, etc) which fail to delete

    I've also examined the drive using Active Disk Editor. I can see that entities have the directory flag set. However, even changing the flag back to zero does not allow deletion.

    I suspect the answer may lie in editing the MFT, but I'm not familiar enough with the details of NTFS to know how to fix the problem.
    Last edited by claytoncarney; 26 Aug 2019 at 18:29.
      My Computer

  2. Ztruker's Avatar
    Posts : 13,521
    Windows 10 Pro X64 20H4 19042.928
       #2

    What about copying everything else off to another drive, format the drive then copy it back?

    Might want to consider using robocopy as it has the ability to preserve dates if that is important to you.
      My Computers

  3. claytoncarney's Avatar
    Posts : 53
    Windows 10 Home 64-Bit
    Thread Starter
       #3

    I was looking for a solution that did not involve reformatting the disk. I have over 1 TB stored and everything is fine except for a few entries.
      My Computer

  4. pepanee's Avatar
    Posts : 1,462
    Windows 10 Professional
       #4

    Try giving yourself full permissions on the directories.
      My Computer

  5. claytoncarney's Avatar
    Posts : 53
    Windows 10 Home 64-Bit
    Thread Starter
       #5

    I am both owner and have full control.
      My Computer

  6. pepanee's Avatar
    Posts : 1,462
    Windows 10 Professional
       #6

    Uninstall the drive's drivers from Device Manager, and let Windows re-install the drivers again.

    Can Not Delete Directory ("The directory name is invalid")-image.png
      My Computer

  7. claytoncarney's Avatar
    Posts : 53
    Windows 10 Home 64-Bit
    Thread Starter
       #7

    Failed to mention previously, but I have already reinstalled the device drivers.
      My Computer

  8. Ztruker's Avatar
    Posts : 13,521
    Windows 10 Pro X64 20H4 19042.928
       #8

    I think you may be stuck with copy/format/restore. Depends on how annoying these files/folders are to you.
      My Computers

  9. claytoncarney's Avatar
    Posts : 53
    Windows 10 Home 64-Bit
    Thread Starter
       #9

    TestDisk MFT Repair reported that the MFT and its mirror were identical. Numerous attempts with Active Disk Editor failed to correct the problem. I was not able to find a step-by-step procedure to delete the directory manually with a hex editor.

    After wasting an entire day on this nonsense, I ended up formatting (FAT32 not NTFS again) and reloading. Absolutely absurd that NTFS is so fragile and that no tools are available to correct the problem!!!
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 13:01.
Find Us




Windows 10 Forums