Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I thought I would try to delete a directory today. Little did I know, Windows wasn't going to let me.

C:\Data\Projects\acme\4.2.0>rmdir /s product
product, Are you sure (Y/N)? y
product\release - Access is denied.

This is happening under a command prompt which is running as Administrator. I thought I would try to figure out who it's owned by, if it wasn't Administrator:

C:\Data\Projects\acme\4.2.0\product>dir /q
 Volume in drive C is Windows 8
 Volume Serial Number is 38F9-44D7

 Directory of C:\Data\Projects\acme\4.2.0\product

01/02/2013  14:47    <DIR>          RADISH\Trejkaz          .
01/02/2013  14:47    <DIR>          RADISH\Trejkaz          ..
01/02/2013  14:47    <DIR>          ...                    release
               0 File(s)              0 bytes
               3 Dir(s)  79,467,786,240 bytes free

"..."? What the hell? Let's ask SysInternals, they usually know how things work:

C:\Data\Projects\acme\4.2.0\product>accesschk.exe release

Accesschk v5.03 - Reports effective permissions for securable objects
Copyright (C) 2006-2012 Mark Russinovich
Sysinternals - www.sysinternals.com

  Error getting security for C:\Data\Projects\acme\4.2.0\product\release:
  Access is denied.
No matching objects found.

It seems like I will have to get to SYSTEM level to delete this directory, even though I created it myself.

I tried some techniques mentioned here:

http://blogs.msdn.com/b/adioltean/archive/2004/11/27/271063.aspx?Redirected=true

None of these work because I don't have the required permissions under an Administrator command prompt. Windows 8 seems to have locked this stuff down so hard that you can't use your own computer anymore.

Trying to take ownership via Explorer gives this cryptic dialog, which suggests clicking a Change button which doesn't even exist on the dialog:

share|improve this question
    
possible duplicate..... use a live linux cd: superuser.com/questions/469683/… or superuser.com/questions/450720/folder-cannot-be-deleted/… –  Logman Feb 4 '13 at 1:09
    
Sounds like the cause is different from mine but that the suggested fix (basically, not using Windows) could be the only way to get around it. –  Trejkaz Feb 4 '13 at 1:14
    
You will have full access to that ntfs hd with any linux live cd once its mounted. No windows virus, permission problem or running app/dll can hide from it. I personally like to figure things out which leads to a lot of time which I do not have anymore :) –  Logman Feb 4 '13 at 1:27
    
Yeah... I know what you mean. I will give Windows the benefit of the doubt and exhaust every suggestion I get which involves not using another OS before I try to mount the image using anything else. –  Trejkaz Feb 4 '13 at 1:31

2 Answers 2

up vote 2 down vote accepted

Boot from Hiren's BootCD (actually you don't really need to burn it, it's possible to drop it on a pendrive), then choose Mini Windows XP from the menu and use it to delete that directory.

I think I don't have to mention that to do this, you must have a Windows XP license - otherwise it's illegal.

Another option is to use some Linux distro with ntfs-3g driver (eg. Ubuntu), which is considered safe for writing NTFS volumes - although this is a special case, so be careful.

Ah, and running chkdsk /r C: may help if that's a corrupted file descriptor problem.

share|improve this answer
    
chkdsk was it. I encountered some other issue at 29% which prevented it completing, but evidently it had already fixed whatever issue it was by that point because I was able to avoid the automatic repair stuff on boot and get in, and now it is deletable. –  Trejkaz Feb 4 '13 at 2:17

Try using 'takeown /f filename' then try to change permissions with cacls/gui. if takeown can't take ownership when running in an admin prompt, you possibly have disk corruption, so running chkdsk on the drive afterwards may help.

Alternatively as has been suggested, delete the file from a Linux distro

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.