Why can't I delete files that "do not exist", but appear in my download directory?

24

4

I've downloaded three videos. I moved them to a different folder where I put all my videos, however a copy of the files still show up in my download directory. I tried (in Explorer and cmd.exe) to delete them, move them, rename them, or open them but Windows says Could not find this item. so the file no longer exist in that directory but it still appears there. How can I remove these from my download folder? I have also tried to replace the file with another by saving over it but instead they sit next to each other side by side and I can delete either one but after that, the other can't be deleted. They also take up no space.

I am using Windows 7 and the files were downloaded via Firefox onto an NTFS file system.

apokaliptis

Posted 2012-02-12T02:47:58.933

Reputation: 1 752

Are they still there after a reboot? – iglvzx – 2012-02-12T02:50:28.247

The Disk Check Required one and I have shut down my computer many times since then. So yes, It is still there after reboot. – apokaliptis – 2012-02-12T03:01:48.307

Do they have a size? – soandos – 2012-02-12T03:02:56.323

4

Try using the 8.3 short name for each file when deleting with cmd.exe.

– Andrew Lambert – 2012-02-12T03:17:45.030

@sorandos: Nope, they take up no space on disk. – apokaliptis – 2012-02-12T03:36:55.347

4Use dir /x to see their 8.3 filename in the command-prompt. – Synetech – 2012-02-12T04:41:28.253

1Thanks for the tip Synetech! Amazed comment works! I will turn this into an answer. – apokaliptis – 2012-02-12T05:00:27.207

Answers

26

I have seen Explorer showing files for a while after they were deleted, so my first guess would be that it was in fact deleted but left behind as a “ghost”.

If however the file is still present after rebooting, then it is not that. Instead, it could have been in use by a program, Explorer, or an anti-virus program. I would suggest trying Unlocker to release/delete it, but again, you said the file was recreated, so it would not be that.

Finally, I am left with only one option: a filename conflict. They are rare (they are not supposed to happen), but certain circumstances (like race-conditions) can lead to them occurring. In this case, the best way to deal with them is the same as when dealing with files with invalid filenames (like those with illegal characters in them or spaces in the DOS days). There are two ways to handle this situation now, both from the command-prompt, so open a command-prompt to the folder containing the files:

  • Use > dir /x  to view the 8.3 format filenames and use that to delete the files in question

or

  • Use wildcards like > del *problem*file* 

Synetech

Posted 2012-02-12T02:47:58.933

Reputation: 63 242

I had the same problem (file visible in explorer but when trying anything on it it says file not found - even after a reboot) with a file in Windows 8.1 and deleting the file with Unlocker did the job (where every other manual solution failed). – AlexV – 2014-06-22T14:29:20.557

i can find it in dir /x but says "The system cannot find the file specified." when trying to delete it – Daniel Cheung – 2015-07-27T15:18:19.640

Hey, I don't know how much this is relevant, but if you use Win 10, as I do, and find this question, like I did, you might find it easier to perform the deletion using the bash shell. You'd need only a simple rm command. Just my $0.02. – Nikhil Itty – 2017-03-30T09:48:00.163

Went to Command Prompt, run dir /x and then made a delete with the correct name. After refreshing my desktop (where the ghost file was), it was gone forever! Thanks for the hint! – Exel Gamboa – 2018-01-24T01:40:38.247

I am successful with your solution of using dir /x, then use the rd command to the folder name displayed from `dir /x. Thank you. – Vu Doan – 2018-03-15T06:45:11.847

Thanks! This file was driving me insane.

Managed to delete mine using a dir /x to get the filename, then using the 8.3 filename (Center Column) in the del command. – killerrin – 2018-09-25T17:43:27.893

1Such invalid file can be created programmatically by careless using fopen function in conjunction with \\?\ – Wodzu – 2014-01-09T13:30:09.233

3

Is'nt related to the Windows 7 explorer auto-refresh bug? May be.

Try this fix by Nick on NGPixel web site:

1) Open My Computer and click Organize > Folder and Search Options

2) Under the View tab, uncheck the Hide protected operating system files (recommended) option.

3) On your desktop, you should now see 1 or more Desktop.ini files. Delete all of them (no, it won’t break your system, they are auto-generated).

4) Reboot your computer. Problem solved!

source: http://www.ngpixel.com/2011/05/29/windows-7-fix-the-explorer-not-auto-refreshing-bug/

Hope this help. Let us know. :)

climenole

Posted 2012-02-12T02:47:58.933

Reputation: 3 180

Nope its not the problem, I will the answer I found tomorrow. I have to wait 8 hours. Thanks for the help though. Others who read this might have the problem you described. – apokaliptis – 2012-02-12T05:16:26.173

Arg; for months now, I have been having the non-refreshing bug in XP’s Explorer, where filename changes or file creations/deletions are not shown and require an F5 to display. And 7’s Explorer has its own, similar but different bug where .EXE files are in use hang around for a while after being deleted, thus making it impossible for folders to be deleted. It’s so annoying. :roll: (Like some of the comments on the NGPixel page, I too do not have a network drive or desktop.ini. Obviously the problem is more complex than just a single causal factor.) – Synetech – 2012-02-12T05:48:58.347

I had the same exact problem as @Synetech, but deleting both Desktop.ini did it. Thank you! – Gaia – 2013-05-24T18:28:09.650

1

Try deleting the specific folder which contains the specific file into the recycle bin. Then go to the recycle bin and restore the file you just deleted. i hope that works for you.

jern

Posted 2012-02-12T02:47:58.933

Reputation: 11

1

I had a similar problem, and what worked for me was creating a file with the same name, then deleting the new file.

Manos Koukoutos

Posted 2012-02-12T02:47:58.933

Reputation: 11

Here is what I did, in Win 10 Home Ed.:

  • open ANY folder
  • under the top Tab "View"/Options/Change Folder and Search options
  • Under General, Clear the File Explorer History
  • < – LAOMUSIC ARTS – 2020-02-07T08:52:22.727