Cannot Delete Empty Folder "Directory Name is Invalid"

Page 1 of 2 12 LastLast

  1. Posts : 5
    Windows 10 Pro
       #1

    Cannot Delete Empty Folder "Directory Name is Invalid"


    Long story short - Upgraded from windows 7 to windows 10 a few months ago, decided to backup Windows 7. Came to the realization that I wan't gonna downgrade and Windows.old was taking up substantial space so I decided to delete it via Disk Cleanup. One folder remained that I could not delete or compress, it was named "System.Printing.dll", all I could do was move it to my Desktop. Every time I try to delete or open it I get a message that saying that file in not accessible and the directory name is invalid. The folder isn't hurting anything, it's just an eyesore. Any help would be appreciated. Thank you.
      My Computer


  2. Posts : 31,593
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #2

    Pureblood89 said:
    One folder remained that I could not delete or compress, it was named "System.Printing.dll".
    Are you sure that's a folder? On my other Win7 PC it's an actual dll file under c:\windows\winsxs\...

    Perhaps its directory listing has been corrupted. Try running Chkdsk from an administrative command prompt and see if it fixes it.

    If that finds no errors, try right-clicking on it and select 'Properties'. On the Security tab the 'Advanced' button will let you take ownership. You should be able to delete it then.

    If that fails, try downloading Linux and make a bootable 'live' USB. From Linux you can delete anything you want (so be careful).
      My Computers


  3. Posts : 5
    Windows 10 Pro
    Thread Starter
       #3

    I've run chkdsk and sfc, no errors or corrupted files. I've reset file permissions, I've tried deleting is safe mode w/o networking - no avail.
      My Computer


  4. Posts : 31,593
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #4

    Time to boot Linux from a USB then. I once had to do that for a similar 'undeletable' file.
      My Computers


  5. Posts : 5,478
    2004
       #5

    Pureblood89 said:
    I've tried deleting is safe mode w/o networking - no avail.
    It is quite common that you can't delete Windows.old but in safe mode? I don't believe you. The file you are trying to delete is "system.printing.dll" is not loaded in safe mode normally. Are you sure?

    Every upgrade I get xxxx.dll (from intel) that can't be deleted but I always can in safe mode.

    Anyway, if you really can't delete it (of course I could be wrong) then as @Bree says you could boot from Linux.

    Alternatively you could hold down the <shift> key and restart. That will reboot you into the RE environment. Go to a command line and then just delete it (or anything else).

    When you boot into WinRE then Windows directory is not locked and you can do what you want (as long as it is not encrypted). Just type delete C:\whatever\whatever.dll
      My Computer


  6. Posts : 5
    Windows 10 Pro
    Thread Starter
       #6

    lx07 said:
    It is quite common that you can't delete Windows.old but in safe mode? I don't believe you. The file you are trying to delete is "system.printing.dll" is not loaded in safe mode normally. Are you sure?
    Cannot Delete Empty Folder &quot;Directory Name is Invalid&quot;-screenshot-4-.png
    Cannot Delete Empty Folder &quot;Directory Name is Invalid&quot;-screenshot-5-.png
      My Computer


  7. Posts : 31,593
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #7

    Despite the name, it certainly appears to be a folder and not an actual dll - the 0 bytes size is a bit of a give-away.

    As windows complains that its name is invalid, have you tried renaming it?
      My Computers


  8. Posts : 5
    Windows 10 Pro
    Thread Starter
       #8

    Renaming does nothing, directory still invalid.
      My Computer


  9. Posts : 31,593
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #9

    Pureblood89 said:
    Renaming does nothing, directory still invalid.
    Did you actually succeed in renaming it, or did it fail with the 'invalid' error?

    Perhaps you can delete it by using its 8.3 name. Open a command prompt, then type cd Desktop to go into that directory. Now type dir /x to list the 8.3 names as well as the long names. Now try deleting it using its 8.3 short name.
      My Computers


  10. Posts : 31,593
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #10

    Pureblood89 said:
    Cannot Delete Empty Folder &quot;Directory Name is Invalid&quot;-screenshot-5-.png
    In the command prompt I see you used the command 'del c:\users\gary\desktop\system.printing.dll'

    That won't actually work for a directory, you need to use the RMDIR command, DEL just works on files.
      My Computers


 

  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 22:51.
Find Us




Windows 10 Forums