10

I'm trying to delete some files from a folder. I've taken ownership of the files and the folder. When I delete these files Windows doesn't report any errors and deletes them. BUT, after I press F5 these files reappear again. There are no messages whatsoever, they are just undeletable.

I know login off will help, but how do I fix it without going through the pain of closing everything down?

P.S. Files disappear from the folder after aprox. 5 minutes.

Update. Turns out my version of Windows did not properly upgrade from test version, so it had some weird disk drive issues.

  • What files? What folder? More details please. – Dan McGrath Feb 7 '10 at 6:48
  • 1
    Steam at the moment, but I've seen this behavior with other programs. – HeavyWave Feb 7 '10 at 6:56
  • MAAAGGGICCC! :D – Alastair Pitts Feb 7 '10 at 7:22
  • 1
    > Update. Turns out my version of Windows did not properly upgrade from test version, so it had some weird disk drive issues. Please, can you elaborate? I'm having the exact same problem and I don't know what to do. My Windows 7 Enterprise x64 was in test version before, but I don't know if the problem is happening since then. If you can tell me what you have done, I would be very thankfully. – user80203 May 7 '11 at 16:12
12

They only appear not to have been deleted, because some other process is still using the file and hasn't finished with it yet.

Take a look at this page at Microsoft's support site:

You cannot delete a file or a folder on an NTFS file system volume

Cause 2: The file is being used

You may not be able to delete a file if the file is being used. To resolve this issue, determine the process that has the open handle, and then close that process.

Depending on how the file is opened (for example, it is open for exclusive access instead of shared access), you may not be able to delete a file that is in use. You can use a variety of tools to help you determine the processes that have open handles to files whenever you want.

[...]

The symptoms of this issue may vary. You may be able to use the Delete command to delete a file, but the file is not actually deleted until the process that has the file open releases the file.

Steam runs continuously in the background, so any files it is using won't be released (and thus properly deleted) until Steam stops running, which is normally only when you log off.

You can use Process Explorer or the handle command (both available from the SysInternals site) to determine which process is still using the file you're trying to delete.

But I don't think it's really a problem - it only looks like a problem. Consider it a display issue.

  • +1 You can use Unlocker (dwld from Filehippo) to see who is accessing the file & unlock the file or kill the process. However Windows should give an error saying the file is in use. (Sometimes just the empty folder is left behind incase its in use) – Ganesh R. Feb 7 '10 at 8:27
  • Thanks. The handle command shows that the handle is opened by a non-existent process. shoots himself – HeavyWave Feb 28 '10 at 9:26
  • This was happening to me, from a Win 2008 server clustered file share. Rebooting wasn't an option because of the other failover cluster resources that would be affected. I found a user who had the file open. – user38537 May 25 '18 at 4:43
3

While researching this problem I found this question first which described my problem in Win7, but did not display a solution (the "bad upgrade" answer was most likely just the disabled service below). Using Process Explorer from the accepted answer pointed me towards "System" (PID 4) keeping the files open, which then lead me to this question:

Why would SYSTEM continue locking executable file handles after the app has exited?

For me the solution was a simple as opening up services.msc and then setting Application Experience to "Automatic".

Disabling indexing could potentially help as well, but that seems like a heavy handed solution and only worth trying if Application Experience is already enabled.

0

I've had exactly the same problem when I turned on indexing (files reappear and then vanish again after 1 minute).

Disabling indexing helped (Control Panel » Indexing Options).

0

I have found that if I use slim cleaner and shred the file, it seems to not come back. I have audio books I want to get rid of and this is the only thing that has worked thus far. Windows 7 won't even let me change the share or the control, so I shred them.

Hope this helps. Imemine

-1

I have the same issue, i was working in visual studio and created a exe, then ran it in VS, and quit the application. But then when i try to build again, VS gives an error that the exe already exist and it can not overwrite it. If i manually delete it, it disappear, but comes back on referesh and VS still face the same error. If i quit VS, and delete the exe, and wait for 1 minute, then its actually deleted.

  • For me the solution was a simple as opening up services.msc and then setting Application Experience to "Automatic". The solution given above works.. thanks :) – Md Imran Feb 9 '17 at 13:52
  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. – Donald Duck Mar 7 '17 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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