Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Undeletable File - Delete



Undeletable File - Delete

Using command prompt to delete files that explorer.exe is locking.
Published by not so gray matter
20 Apr 2010
Published by

How to Delete an "Undeletable" File

information   Information
This tutorial shows you how to delete undeletable files and folders. There are times when explorer.exe somehow locks files into place and won't allow them to be deleted. In order to delete them you must close explorer.exe and use a command prompt to delete the file.


Tip   Tip
Be very careful when deleting files through command prompt, it's possible you could accidently delete the wrong file.


1. - Open an elevated command prompt
Start > Search "cmd" > Right Click cmd.exe > Run as Administrator

Name:  opencmd.png
Views: 24064
Size:  23.0 KB
2. - Leave Command prompt open; Open task manager
Undeletable File - Delete-opentm.png
3. - End process "explorer.exe"
Name:  endexphowto.png
Views: 24269
Size:  61.8 KB

Name:  explorerend.png
Views: 24049
Size:  22.2 KB
4. - Switch back to command prompt
Undeletable File - Delete-switchcmd.png
5A. - FILE - Change to the directory of your file and delete it.
First run this line: cd "PATH OF YOUR FILE"
i.e. cd "%USERPROFILE%"\Downloads"
Now run this line: del filename.extension
i.e. del filename.mkv

Name:  commanddelete.png
Views: 26203
Size:  29.3 KB
5B. - FOLDER - Delete the folder.
Enter Command: RD /S /Q [DRIVE:]\PATH\TO\FOLDER
i.e
RD /S /Q C:\Users\[username]\Downloads\FOLDERNAME

Name:  removefolder.png
Views: 25066
Size:  41.6 KB
6. - Switch back to task manager
Undeletable File - Delete-switchtask.png
7. - Restart "explorer.exe"
Name:  newexphowto.png
Views: 23954
Size:  60.6 KB

Name:  newexp.png
Views: 23876
Size:  32.4 KB

.

04 Aug 2011   #1
drifking8887

windows 7
 
 

thank you very much.it was a real sick for me. thanx again

My System SpecsSystem Spec
.

15 Oct 2011   #2
claudzen17

windows 7 32bit
 
 

men..!! thanks for this wonderful tweaks it took me 7hours just finding for the right solution!
this works with me, now my undeletable file is gone forever..
i have registered myself here just to give you my thanks..
My System SpecsSystem Spec
10 Oct 2012   #3
swilly

Windows 7 Professional 64bit
 
 

Thanks notsograymatter,

Excellent solution to a problem that had troubled me for a few days. It worked for me deleting files from an external USB drive, on Windows Server 2008R2. Much appreciated.
My System SpecsSystem Spec
05 Feb 2013   #4
lavanya46

Windows 7 x64
 
 

Thanks, this was a great help. Worked perfectly.
My System SpecsSystem Spec
07 Mar 2013   #5
Hellblazre

Windows XP Service Pack 3 32bit
 
 

Good god, THANK YOU! I had this url link i couldnt delete and thanks to your technique i finally got rid of the little *******. XD
My System SpecsSystem Spec
29 May 2014   #6
tweakradje

win7
 
 

Thanks for the solution.

Something is wrong with explorer in Windows 7 (apart from the annoying copy/calculating etc. while copy/del)

I also thought it had something todo with with ownership, but it hasn't. My trick was always:

takeown.exe /F "*" /a /r /d y (with elevated cmd box) and it worked. But only after a wait.

This owner unknown trouble always start with a explorer map move, an update of a program, or another file operation.
What happens I think is that the file is marked for deletion, ownership already removed, and waits for explorer to remove it from memory(?), so that it can be removed from disk. I have (super-)(pre-)fetch disabled btw.

I hope someone finds the cause of this.
My System SpecsSystem Spec
13 Jun 2014   #7
Audio86

Windows 7
 
 
Help....this doesn't work!

I have tried all these tricks and Assassin etc. and still have 6 .m4a files hanging out on my desktop. More ideas?!

Thanks
My System SpecsSystem Spec
13 Jun 2014   #8
Brink
Microsoft MVP

64-bit Windows 8.1 Enterprise
 
 

Hello Audio86, and welcome to Seven Forums.

See if you may be able to delete them in a command prompt at boot (step 4 below) instead.

File - Delete from Command Prompt

Hope this helps,
Shawn
My System SpecsSystem Spec
Comment

 Undeletable File - Delete




Tutorial Tools



Similar help and support threads for2: Undeletable File - Delete
Windows 7 Tutorial Category
Undeletable File Performance & Maintenance
Solved How to delete Undeletable folders or files from any Drive General Discussion
undeletable file Software
Solved Undeletable File General Discussion
User Accounts and/or undeletable file? General Discussion
Mysterious Undeletable File Performance & Maintenance
Solved Undeletable file problem General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 05:54 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33