Windows 10: Problem with deleting directories from the c dive. Solved

  1.    04 Jan 2016 #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 ComputerSystem Spec


  2. Posts : 11,235
    W10Prox64
       04 Jan 2016 #2

    TexasJohn said: View Post
    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 ComputerSystem Spec

  3.    05 Jan 2016 #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 ComputerSystem Spec

  4.    05 Jan 2016 #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 ComputerSystem Spec

  5.    05 Jan 2016 #5

    That worked!


    Thank you, the icacls command did the trick. All those directories have now been deleted.
      My ComputerSystem Spec


 

Related Threads
I've been backing up some of my stuff on OneDrive, and today, when I tried to rename one of the folders on OneDrive I got an error message saying that the path was too long. I clicked No/Cancel/Whatever-it-was-called thinking that it would abort the...
Hi, I hope this can be reversed. I was using my machine normally when it suddenly went dead while using file explorer, no BSOD, just stopped, no cpu activity light, nothing responsive. I had to power off at the PSU and then re-start which it did....
CD/DVD Dive down in Drivers and Hardware
The upgrade from Windows 7 to Windows 10 knocked my CD/DVD Lightscribe drive out. At the moment it isn't a problem, as these days most everything can be run without a CD, but long-term it will cause me some measure of inconvenience. I've checked...
I have not been able to delete favorites from the "Favorite Bar" drop down list. The right-click and the delete key do not work.
Source: A deeper dive into the Universal Windows Platform
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 08:17.
Find Us