2

My Windows 7 is doing this recently. From time to time some files of different origins can't be deleted. Sometimes it's a PDF I've just downloaded, sometimes it's a source code file I'm editing on Eclipse.

I tried Unlocker and it says nothing is locking them.

Also, explorer doesn't work well with them. The simple act of right clicking the file makes explorer freeze. Opening the file with notepad++ freezes the notepad. If I use cmd.exe I can DIR the file, but if I try DIR /Q, or DEL /F, cmd doesn't return. If I press SHIFT + DEL on the file, the delete dialog shows and the progress bar moves back and forward forever and the statistics of deletion are always 0.

If I logout and login again, the file is still "locked". The only thing that solves is rebooting the system.

Any ideas on what is going on with these files?

UPDATE: I'm having the same issue described here: Unresponsive file causes Windows Explorer to stop responding

Gustavo
  • 163
  • 1
  • 2
  • 9
  • Can you think of anything common that these "locked" files share? (only downloads, special characters in filename, certain file size, certain file type, etc) – Steven Dec 16 '15 at 20:01
  • 2
    Check for file-system/disk corruption (`chkdsk`). – Ƭᴇcʜιᴇ007 Dec 16 '15 at 20:07
  • 1
    often invisible characters in file names can cause this kind of bizzare behavior. have you tried renaming it to somthing innocous, like `thing1.pdf`? – Frank Thomas Dec 16 '15 at 20:08
  • Do you have any software installed that has a thumbnail or context menu handler that may be crashing when file info is queried? Any e.g. video players, PDF viewers, anything like that that is taking some responsibility for generating file thumbnails / metadata values in explorer? – Jason C Dec 16 '15 at 20:08
  • Also grab [Process Explorer](https://technet.microsoft.com/en-us/sysinternals/processexplorer.aspx), when you find a locked file like this, open Process Explorer, press Ctrl+F and type in part of the filename then search to see if you can find something that has it open (which may just be explorer.exe though if e.g. it's a thumbnail handler or something). (But run chkdsk first just to rule that out.) – Jason C Dec 16 '15 at 20:10
  • @Steven First, I noticed this in some PDFs I downloaded from an application running in a Tomcat managed by an Eclipse running in the same Windows. Now, it happens to files being manipulated by Eclipse. Basically, Eclipse can't build my project because it can't delete (clean) some file in the build folder. So, Eclipse seems to be involved. The files are pretty small. Common file names. I made sure eclipse.exe and Adobe reader are not running. But the lock/corruption continues. – Gustavo Dec 16 '15 at 20:10
  • @Gustavo Try temporarily uninstalling Adobe Reader completely to remove its shell extensions, too. See if that changes something. – Jason C Dec 16 '15 at 20:11
  • @FrankThomas I made you think it happens a lot with PDFs. It doesn't. It happened 3 times with PDFs, now it happens twice a day when I'm using Eclipse. I edit something in a file, Eclipse starts to build things and it can't because some file is "locked/corrupt". – Gustavo Dec 16 '15 at 20:20
  • @JasonC Tried Process Monitor, and now Process Explorer. I started the deletion of the file, when the dialog showed, I searched for the evil file. No matches. – Gustavo Dec 16 '15 at 20:26
  • then that does sound like it could be file system corruption caused by a progressive media failure. check your disks SMART stats and do a chkdsk. then check the SMART stats to make sure your Reallocated and Current Pending sector counts are unchanged from before. if they have changed, its time to buy a new disk. – Frank Thomas Dec 16 '15 at 20:28
  • @FrankThomas I ran chkdsk, but in order to do this I had to restart the machine. Windows booted so fast after the chkdsk that I couldn't see the results very well. There were 0 bytes in defective sectors. Excuse my ignorance: where do I check these SMART stats? – Gustavo Dec 16 '15 at 20:42
  • I usually use SpeedFan in windows to check smart stats, but the 0-bvytes message does bode well. – Frank Thomas Dec 16 '15 at 20:44
  • @Gustavo Have you tried temporarily uninstalling Adobe Reader? Try also temporarily disabling any antivirus background or on-access automatic scanning you may have. The no-op with chkdsk is a good sign. If errors were found it would have alerted you in a dialog upon reboot, IIRC. It also would not have zipped by so fast. – Jason C Dec 16 '15 at 21:33
  • @Gustavo [CrystalDiskInfo](http://crystalmark.info/software/CrystalDiskInfo/index-e.html) is another good one for SMART stats but tbh it's not sounding like a drive failure any more. Doesn't hurt to check though. My personal running theory is some misbehaving shell extension. Adobe Reader has an old history of issues although they were generally fixed long ago. I don't know though I haven't used it in a while (I switched to Sumatra PDF a long time ago, I am also running Win 7). You might also try running in safe mode to see if that solves the issue, then you can at least narrow it down a bit. – Jason C Dec 16 '15 at 21:36
  • @Gustavo A few other quick thought `1.` sometimes Anti-Virus or other software can have files in use to try disabling your AV or other software one-by-one and then try deleting the files you have trouble with until you find the cause. once found you can do a `TASKKILL /F /IM ""`. `2.` Try killing explorer `TASKKILL /F /IM "explorer.exe"`, run `DEL /Q /F ` and then `explorer.exe` from command prompt. Something has the files in use so you just have to figure out what, then build a quick batch to kill, delete the files, then start the app, etc. again. – Vomit IT - Chunky Mess Style Dec 17 '15 at 04:51

2 Answers2

1

It ended up being Windows Search service locking files and then crashing itself.

Eclipse writes lots of files during build and checkout of project branches. My workspace is located in my home folder which is one of the folders indexed by Windows Search. I believed this contributed to the service crash.

I just added an exception to the service not to index the workspace folder. I've been using Eclipse for days and no more files were locked.

Thank you guys.

Gustavo
  • 163
  • 1
  • 2
  • 9
1

*** This has already been answered...but here's my own experience & solution.

Win7...Explorer crashes on discovering folders containing buggy audio files, eg wav file, mp4 file, mp3 file or similar badly encoded files.

No other program could delete these files (including Explorer) EXCEPT a small FREE program called File Assassin by Malwarebytes.

https://www.malwarebytes.com/fileassassin/

Once open just use the "Use delete on Windows reboot functions" setting, then click "Execute" & restart your computer as normal.

Check that the problem file is gone when your PC starts up.

*** Don't dick around with CMD prompts & registry hacks...this is the SAFEST & SIMPLEST METHOD!!!

Good luck!

kingal73
  • 11
  • 2
  • Thank you so much! This software was the only one that could delete a broken opus file in my Downloads folder. (Using Win 10, still not fixed) – Berny23 Sep 25 '21 at 12:45