Why do deleted files still show up in Explorer until I refresh the folder?

18

9

Note: I am fully aware that this question is a dupe of Icons of deleted files remain until refreshed. However, that question is over two years old, has few views, has no answers, and doesn't convey the issue very well. Therefore, I am asking a new one.

My question:

Infrequently and at random, deleting a file via Windows 7 Explorer does not remove the file from the file list. This makes me think my delete was unsuccessful, so I try to delete the file again only be greeted with Could not find this item. Only after I refresh the window does the deleted file disappear.

As I said, this occurs randomly. Explorer behaves like it should the vast majority of the time, but there is always that one day that Windows 7 just isn't feeling very well and stops updating the Explorer window. This makes it near impossible to troubleshoot since it essentially fixes itself when it feels like it.

Answers/comments I would rather not see posted here:

  • Troubleshooting solutions. I am not going to "try this". This includes things like "Try creating a new user account and see if it works there."
  • Links to discussion threads on other websites that do not clearly show one person's solution as the fix, especially if the thread is full of people saying "I tried this, but it didn't work" and "Has anyone found a solution yet?".

Here are the types of answers I do want to see:

  • An official Microsoft hotfix that addresses this issue specifically.
  • If nothing else, an objective reason why this is happening so that I knew exactly how to reproduce the issue so that I know how to avoid it in the future.

Thanks.

oscilatingcretin

Posted 2013-07-11T12:42:48.067

Reputation: 4 093

Also affected during creation of text document. Right Click > New Text Document. No document is seen. Hit f5 and document appears with renaming highlighted. Was very annoying.. – Bharat G – 2015-09-07T16:41:05.677

1Lived with this on Windows 8.1. Clean install of Windows 10... it still happens. F5 corrects the UI. The problem is we shouldn't have to use F5. The UI should accurately represent the file system's state. – Tristan – 2016-01-09T23:14:32.640

For me it was broken file permisions, shift delete was allowed but showed up after refresh. Move to trash is not allowed... – clankill3r – 2016-06-15T14:23:39.560

The problem is I have never observed this behavior for a local file on a clean installation of any version of windows 7+. I have seen it in folders controlled by a program (ie, Dropbox, Sharepoint) and on network drives. Most of these could be fixed with a "f5" refresh. Are you claiming you observe this behavior on a clean installation of windows? Otherwise, we'll have to know what programs you are using, which is just a wild goose chase. – PatKilg – 2013-07-11T12:59:45.843

6I did observe this behavior too, just in Windows Explorer. In these case "f5" solves the issue indeed. – Bernhard – 2013-07-11T13:54:29.773

Answers

4

I have seen this issue before and it always seems to be related to libraries and windows indexing.

Here are some basics:

Libraries are basically simple shortcuts that can open multiple locations with a single click. If you move a folder or directory that is connected to a library the library shortcut will still show the contents of that folder. I believe there may be some unique handling when you use a library shortcut to access these folders and so windows indexing system may sometimes fail to update properly.

Indexing is a system used so that when you search for a file instead of windows physically searching all or portions of a hard-drive, it can simply search a list of files and locations. This list, I believe, is usually stored in a single location. This can speed up searches and displaying file lists. If for some reason, the indexing system doesn't remove a file from it's index after it's been deleted, it may continue to show up in folders.

The last time I had this issue I did an index rebuild and the offending files went away. I don't know what actually causes this, nor have I discovered how to duplicate the issue. I suspect it MIGHT be possible that after deleting a file, the computer is rebooted or a program clears out the memory of that action being done so the indexing system doesn't update properly and because the indexing system has essentially forgotten that you deleted a file and doesn't detect a successful file deletion, the file "ghost" remains. If this is correct then Microsoft would have to adjust the indexing system to check it's index if a file delete is attempted and fails. Till then, I'm guessing that rebuilding the index might be the only way to resolve the issue.

Win7:

  1. Click on your start button and search for index. You should find Indexing Options.
  2. Click on Indexing Options.
  3. Click The Advanced Button (Admin/elevated privileges needed)
  4. Click Rebuild.

{Indexing options can also be found in Control Panel When Large or Small icons instead of Category is selected.}

In most cases if you are using SSD drives indexing may not increase the speed at all. If this is a constant issue, you could try simply turning the indexing service off. This will, however, slow down searches and displays of directories with a large number of files.

Drew The Geek

Posted 2013-07-11T12:42:48.067

Reputation: 41

Indeed, I paused indexing and the deleted forlders disappeared :-o – t3chb0t – 2018-05-07T06:19:20.300

3

I found this link and it helped (without having to disable libraries or whatsoever...):

http://deputycio.com/8440/deleted-files-not-disappearing-in-windows-7-explorer-without-refresh

In case this link gets outdated some day, here is a quote:

Go to “Folder Options” (my easiest way is Windows key+E to open a Windows Explorer, Press Alt to get the menu, click on Options and Folder options), then click on the “View” tab and click on the “Reset Folders” button. That did it and now files disappear from my view as soon as I delete them.

Hope this helps.

andreee

Posted 2013-07-11T12:42:48.067

Reputation: 133

1

I think this is a case where several unrelated issues result in similar symptoms. That's why different folks report success with different solutions. Furthermore, several issues can occur concurrently, so fixing one will not resolve all symptoms, leading to the belief that the fix was entirely ineffective.

If this happens consistently with PDF files and only when the Preview Pane in Explorer is open, Adobe Reader is locking your files.1 It's also possible that Reader is locking your files while generating thumbnails. You have the following options:

  1. Disable the Preview Pane.2
  2. Use Unlocker to unlock individual files after previewing, but before deleting, or when the files reappear after a failed delete.3
  3. Install an alternative PDF reader and ensure that it is designated as the preview handler for PDF files. This change may also affect PDF previews in other programs such as Outlook. You do not have to uninstall Reader or Acrobat.

Since I followed through with #3, I'll elaborate on that option. I went with the Sumatra PDF reader, since it's lightweight and does not lock files. You must use the installer version, not the portable version.

When installing, click Options and check Let Windows show previews of PDF documents. If you wish to keep Acrobat or Reader as the default program for actually opening PDF files, avoid checking the Use SumatraPDF as the default PDF reader option.

I can confirm that this fixed the issue for me. Other discussions on the matter recommended renaming the AcroRd32.exe file, but that would disable PDF previews entirely, and it would revert anytime Acrobat/Reader is updated. This is a more elegant solution.


1. Adobe Acrobat ships with a version of Adobe Reader that's used for file previews. Even if you do not have a standalone Reader installed, you will run into this issue with Acrobat. Allegedly, older versions of Reader (5 and 6) do not lock files.

2. I haven't confirmed that Reader locks files on thumbnail generation, but if that's the case, disabling the Preview Pane will not fix this issue. Tentatively, using an alternative view (e.g. List or Details) should help in that regard.

3. You can write an AutoHotKey script to get the currently selected file in Explorer, run Unlocker in commandline mode to unlock that file, then perform a delete or move operation. It might be possible to detect when a file is being moved or deleted in Explorer and use that as a trigger for the script. This is a complex option. I might give it a try, but for now, consider this as an exercise to the reader.

Illya Moskvin

Posted 2013-07-11T12:42:48.067

Reputation: 133

0

As I've mentioned in my other answer here regarding PDF files, several distinct issues can cause similar symptoms concurrently. Unfortunately, that was true in my case. I found another possible solution to this problem.

After deleting, moving, or uninstalling an EXE file, you might find that it remains in place for several minutes, perhaps permanently. Attempting to delete the file again will result in an You need permission from SYSTEM to make changes to this file error.

If this sounds like your situation, take a look at this thread: Why would SYSTEM continue locking executable file handles after the app has exited?

According to the top answer, disabling indexing and enabling the Application Experience service will solve this issue. In my case, indexing was already disabled; enabling the service solved the issue.

Given that the Application Experience service is set to "Manual" by default (source), I must have disabled it at some point while tweaking my system. I believe this fulfills the "official Microsoft" aspect of the question.

Illya Moskvin

Posted 2013-07-11T12:42:48.067

Reputation: 133

You should be specific in which answers you are talking about. The order of answers are likely to change over time. – Ramhound – 2016-01-10T09:18:48.597

@Ramhound: Thank you, I've edited my answer accordingly. I consulted the meta discussion at http://meta.stackexchange.com/q/25209 before posting, and this solution seemed distinct enough to merit its own answer. Also, if the introductory paragraph is extraneous, or if there's a way to improve this answer, please feel free to edit it.

– Illya Moskvin – 2016-01-10T09:38:29.093

I allow users to fix their own content. I only do things that a user couldn't do themselves, say inline a screenshot, if they can't be bothered to make the edit to improve their own question or answer I figured I shouldn't go to the effort either to improve it myself – Ramhound – 2016-01-10T09:44:44.867

@Ramhound: Completely understandable. I'm not yet used to the StackExchange writing style and tone. It's hard to gauge how much information is too much, and how much, too little. – Illya Moskvin – 2016-01-10T09:46:50.870

1You can never have to much relevant information. You can never be specific enough. The more detailed an answer is, provided it answers the question itself, the more helpful the answer will be to the community. – Ramhound – 2016-01-10T09:49:25.663

0

For me it happened for a directory which was a SVN checkout, with explorer opened.

After deleting .svn directory, TSVNCache.exe kept directory "opened" (although it did not exists on disk, on explorer was still shown). Killing TSVNCache.exe and closing explorer windows solved the problem.

Bottom line: although deleted, most likely there are still pending handles opened in Windows.

Cristian Amarie

Posted 2013-07-11T12:42:48.067

Reputation: 11

0

Restarting Windows Explorer from the Task Manager solved this for me.

Praneel

Posted 2013-07-11T12:42:48.067

Reputation: 1

-1

I tried a number of options in vain, but what worked for me is to disable the Library feature of Windows Explorer.

To do this, follow the instructions on howtogeek.com to modify your registry.

Thorsten

Posted 2013-07-11T12:42:48.067

Reputation: 137

You are encouraged to include all relevant information from links you believe answer a question. – Ramhound – 2016-01-10T09:16:02.377

-3

Simply place a new file with the exact same name as the ghost file into the same folder. The ghost file will be forced to disappear.

James

Posted 2013-07-11T12:42:48.067

Reputation: 1

What good does this do?  Sure, the “ghost file” will be forced to disappear — *because it’s been replaced by a new one!*  How is that a solution?  The OP wants the file to disappear, and your answer suggests reaffirming the file’s existence.  Sure, they can then (try to) delete the newly created file, and run the risk of repeating the whole scenario.  This is a lot more work than just pressing (F5), which has been mentioned. – Scott – 2018-11-01T02:42:47.467

While this may not be a good solution, it is a legitimate attempt to answer the question. – I say Reinstate Monica – 2018-11-01T03:15:29.193

@TwistyImpersonator lmao I hope you're just trolling, because that's rich. – oscilatingcretin – 2018-11-01T06:16:27.660

@oscilatingcretin Nope. According to the FAQ this is a legitimate answer and it should not be flagged as NAA (A Not An Answer). Specifically, one is not to use the NAA flag when "The answer makes an attempt to answer the question, even if it is wrong or inaccurate or you disagree with it"

– I say Reinstate Monica – 2018-11-01T06:57:09.737

@TwistyImpersonator Maybe so, but I fail to see how citing that provision is relevant here when you consider that Scott (to whom you were responding) was only criticizing the answer, not advocating that it be flagged as NAA. – oscilatingcretin – 2018-11-01T13:01:07.307

@oscilatingcretin I was not responding to Scott. I was proactively commenting so that should the answer be found in the VLQ queue it would be reviewed correctly. Sometimes uninformed reviewers wrongly recommend deletion of answers like this one. – I say Reinstate Monica – 2018-11-01T13:04:58.537

@TwistyImpersonator Never ASS U ME. – oscilatingcretin – 2018-11-01T13:17:05.027

@oscilatingcretin :-) No worries. Thanks for taking the seriously the task of maintaining quality content on this site. – I say Reinstate Monica – 2018-11-01T13:19:03.540

-3

I can't remember the exact technical reason, but IIRC it is a combination of explorer not checking if the file is deleted, thus displaying a ghost icon, and a strange behavior of windows 7 that makes undeleteable empty copies of a deleted file that has been modified/executed recently. The only solution to this is normally to wait a few minutes for windows to fix itself or restart explorer.exe.

There is unfortunately no permanent solution thay I know of.

Anon

Posted 2013-07-11T12:42:48.067

Reputation: 28

This question os not about undeletable entries, but files that have already been sucessfully deleted being still shown on explorer until pressing F5. – That Brazilian Guy – 2013-10-28T02:31:53.070

-3

Go to task bar right click on it, click on start task manager, click on processes, find explorer and after clicking on it click on end process. After that go to application tab/new task/type explore then hit Enter!

This should fix the problem.

jeevan joshi

Posted 2013-07-11T12:42:48.067

Reputation: 1

3This isn't really a solution. This just just an alternative to hitting F5. – Ramhound – 2014-11-15T14:31:13.607

-3

  1. In the top left of a Explorer window click Organize
  2. Click Folder and search options on the drop-down menu
  3. On the View tab select Don't show hidden files, folders, and drives
  4. On the Search tab click Restore Defaults
  5. Click OK

stran

Posted 2013-07-11T12:42:48.067

Reputation: 1

-3

see, the easiest way to remove them is that just select those files, then right click, organise (on top left) and then remove properties. This works 100% surety, I tried it myself!!!!

Shrey Verma

Posted 2013-07-11T12:42:48.067

Reputation: 1

-4

  1. Open a Windows Explorer window.
  2. Right-click on one of your hard drives and choose Properties.
  3. Click the Hardware tab.
  4. Choose the physical hard drive that has the problem.
  5. Click the [Properties ] button.
  6. Click the Policies tab
  7. Click "Turn off Windows Write-cache buffer flushing on the device"

    Note the warning Microsoft provides for this setting. If you do find you prefer this setting, make sure you understand that you're taking some additional risk of data loss by choosing this setting.

  8. Click OK to back out of everything.

Kev MacD

Posted 2013-07-11T12:42:48.067

Reputation: 5

Criteria stated by OP: A. An official Microsoft hotfix that addresses this issue specifically. or B. An objective reason why this is happening so that I knew exactly how to reproduce the issue so that I know how to avoid it in the future. – Rsya Studios – 2014-12-05T01:04:29.347

-4

I had this issue Some time back. Follow these steps and see if it works.

  1. Right click inside Explorer window and click Sort by
  2. choose Name.

This solved my problem.

Cowboy4823

Posted 2013-07-11T12:42:48.067

Reputation: 1

1This is not a long-term solution. What if I have everything sorted by modified date or file type? I may as well just hit F5 to refresh the window while also preserving the original sorting. – oscilatingcretin – 2015-05-20T14:40:30.653

-4

  1. Install Cygwin from http://cygwin.com This allows linux style commands in windows.
  2. Open cygwin
  3. Use the following linux command to force the folder/file to delete. CAUTION: ONLY DO THIS IF YOU KNOW YOU'RE TYPING THE CORRECT FILE OR FOLDER PATH. THIS WILL FORCEFULLY DELETE THE FILES OR FOLDERS THAT YOU SPECIFY. IF YOU DON'T KNOW HOW TO NAVIGATE FILE SYSTEMS VIA COMMAND LINE, DO SOME RESEARCH.

The basic commands: cd J:\foldername (whatever drive letter and folderpath you're after)

ls (this lists all the files in your current folder. make sure the file or folder you want to delete is in there)

rm -Rf filename (this forcefully deletes the file or foldername you specify. Carefull! Only do this if you want that file or folder do disappear!)

  1. Check in Windows Explorer and see that the files/folders are actually gone.

NOTE: These forcefull commands can be dangerous. Only use them if you're not a bonehead.

Kris-Innovate

Posted 2013-07-11T12:42:48.067

Reputation: 1