Problem with deleting directories from the c dive.


  1. Posts : 4
    Windows 10
       #1

    Problem with deleting directories from the c dive.


    I have about 500 empty directories on my c: drive with names like the ones pasted below. I believe a failed Quicken install left them there. Anyway, normally this would be no big deal, but in this case, they are all at the root level and it makes my "real" directories hard to find. I've tired several things to get rid of them. Here's an example of one of my attempts from an Administrators command shell:

    dir *.tmp
    . . .
    09/11/2015 04:51 PM <DIR> QuiFAC7.tmp
    09/11/2015 04:51 PM <DIR> QuiFAC8.tmp
    09/11/2015 04:51 PM <DIR> QuiFAD9.tmp
    0 File(s) 0 bytes
    501 Dir(s) 1,337,724,145,664 bytes free

    C:\>rmdir quifad9.tmp
    Access is denied.


    C:\>takeown /f quifad9.tmp /a


    SUCCESS: The file (or folder): "C:\quifad9.tmp" now owned by the administrators group.


    C:\>rmdir quifad9.tmp
    Access is denied.

    I've tried it with PowerShell and with the "hidden" Administrator id, no luck. I also tried to change the security setting for the c: drive itself, also with no luck. Do any of you have a PowerShell script or something similar which will remove these annoying empty directories?

    John



      My Computer


  2. Posts : 16,325
    W10Prox64
       #2

    TexasJohn said:
    I have about 500 empty directories on my c: drive with names like the ones pasted below. I believe a failed Quicken install left them there. Anyway, normally this would be no big deal, but in this case, they are all at the root level and it makes my "real" directories hard to find. I've tired several things to get rid of them. ....

    I've tried it with PowerShell and with the "hidden" Administrator id, no luck. I also tried to change the security setting for the c: drive itself, also with no luck. Do any of you have a PowerShell script or something similar which will remove these annoying empty directories?

    John
    Hi TexasJohn and welcome to Tenforums.

    Perhaps you can try booting to this custom Win10PE disk one of our members has prepared.
    Windows 10 Recovery Tools - Bootable Rescue Disk - Windows 10 Forums

    You can try deleting the directories that way.
      My Computer


  3. Posts : 42,957
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #3

    The trick is to delete them without Windows running. Thus if you have Windows installation media, you can boot from that, select Repair, Troubleshooting, and navigate to a command prompt.
      My Computers


  4. Posts : 5,478
    2004
       #4

    The owner of an object doesn't necessarily have authority to do anything with it (except change authority). You have to both take ownership and grant authority - it was the second step you were missing.

    As they are directories you should specify /r on takeown and /t on icacls to recurse through any contained files/directories also.
    Code:
    takeown  /f  quifad9.tmp /r
    icacls  quifad9.tmp /grant "%USERDOMAIN%\%USERNAME%":(F) /t

    If they are locked though you'll need to delete them from outside windows (or at least when whatever is locking them isn't running) as mentioned in the posts above.
    Last edited by lx07; 05 Jan 2016 at 05:36. Reason: recurse
      My Computer


  5. Posts : 4
    Windows 10
    Thread Starter
       #5

    That worked!


    Thank you, the icacls command did the trick. All those directories have now been deleted.
      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 07:23.
Find Us




Windows 10 Forums