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.

On Windows XP I've made a copy of my home directory. Now I want to remove it, but there's a directory with two files which I can't get rid of:

N:\COPY-OF-HOME\Local Settings\Application Data\Microsoft\CardSpace

The directory is read-only, and I can't change it (access denied). Cacls shows the following

Everyone:(special access:)
         READ_CONTROL
         SYNCHRONIZE
         FILE_READ_ATTRIBUTES

BUILTIN\Administrators:(special access:)
                       READ_CONTROL
                       SYNCHRONIZE
                       FILE_GENERIC_READ
                       FILE_READ_DATA
                       FILE_READ_EA
                       FILE_READ_ATTRIBUTES

and I can't change it either. I do have the administrator privileges. For copying I didn't use any fancy tool, so I'd expect me to be the owner of the copy. Why can't I delete it? Do I need to boot Linux?

share|improve this question

3 Answers 3

Open a Command Prompt window and leave it open. Close all open programs. Click Start, Run and enter TASKMGR.EXE Go to the Processes tab and End Process on Explorer.exe. Leave Task Manager open. Go back to the Command Prompt window and change to the directory the AVI (or other undeletable file) is located in. At the command prompt type DEL where is the full path to the file you wish to delete. Go back to Task Manager, click File, New Task and enter EXPLORER.EXE to restart the GUI shell. Close Task Manager.

share|improve this answer
    
I don't understand why this should work. Are you assuming the file is locked? –  maaartinus Feb 12 '11 at 22:33
    
I am assuming you will try what I suggested. –  Moab Feb 12 '11 at 22:49
    
You're assuming correctly. And I was assuming it wouldn't work. And it didn't. –  maaartinus Feb 12 '11 at 23:32

you could try displaying who the owner is (dir /q). Also try logging in as Administrator, and changing ownership to Administrator(google taking ownership). Can you then still not set Everyone to have write access?

you can also try Process Explorer, and see what process if any, is locking the file and end the process. Sometimes(I think in the case of svchost.exe) you can move the mouse over that process in process explorer and see a particular service and stop that and delete the file.

if you are desperate and give up doing it properly,

you could try a program called unlocker. Or a form of Win XP PE(a Win XP "Live CD" so to speak) like Bart's or UBCD.

share|improve this answer
    
I don't think the files could have been locked. There's no reason for anybody to lock them, it was just a copy of something. I've never used these files, I haven't even looked in the directory (the copy was done for a purpose which I gave up in the meantime). I should have looked who was the owner, but now it's too late, I booted Linux and solved it. –  maaartinus Feb 13 '11 at 23:16
    
@maaartinus locking doesn't work like some person decides to lock it. UBCD or Bart's , is like the linux solution(linux live cd) you used, but a windows version. You chose an easy route(the same kind of solution as the final thing I described) which is good if you're desperate, but doesn't tell you what was going on. –  barlop Feb 14 '11 at 5:54
    
I know very well what happened. For absolutely NO REASON Windows decided to deny the computer owner and administrator the right to delete an absolutely useless file, just a self-made copy of something. The only purpose I can imagine is to drive me crazy. –  maaartinus Feb 14 '11 at 6:29
    
@maartinus you don't understand computers, or that it's a computer. This website is called superuser. Not for people that blabber about computers doing things for no reason. –  barlop Feb 14 '11 at 7:17
    
@maartinus If you want to be more rational and not so stupid, then you should understand that it's not for "no reason". It's for a reason you don't know(and perhaps nobody else does since you chose the route you did - a good route, but one that doesn't diagnose it), and clearly the reason(which was derivable from diagnosis and may be of benefit for reasons other than knowledge) is of no interest to you. –  barlop Feb 14 '11 at 7:21
up vote 0 down vote accepted

I've read a lot posting about this here and on elsewhere on the web. Conclusion: It's just hopeless. There may be a solutions for any particular case, but there are just too many cases:

  • Filenames valid in NTFS but invalid in Windows
  • Files lock by a running process
  • Files lock by a process not running anymore
  • Filenames with non-ASCII characters
  • Filenames ending with spaces
  • Strange ACL
  • Strange owner

There was even somebody here who tried 4 answers in row, where each helped to remove some files.

Nevermore! Booting Linux from a CD or USB is the only way I'd ever recommend to anybody. It works always and the reboots take less time than the more fancy solutions I've seen.

share|improve this answer
    
Can you post a links to the somebody who tried 4 answers in a row where each helped? it sounds v interesting. –  barlop Feb 14 '11 at 5:57
1  
It may be this one or maybe not, however, it's bad enough. –  maaartinus Feb 14 '11 at 6:23
    
@maartinus +1 that link is interesting and useful –  barlop Feb 14 '11 at 12:30

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.