Many times when trying to remove an unwanted program, especially a piece of adware or spyware, you may run across a file that is undeletable by any normal method. When you try to remove it you'll receive the error message shown below telling you "access denied" and explaining the file may be in use.  You may also receive one of the following messages.

Cannot delete file: Access is denied
There has been a sharing violation.
The source or destination file may be in use.
The file is in use by another program or user.
Make sure the disk is not full or write-protected and that the file is not currently in use.




So if the file is in use, how do you delete it?

I'll show you several ways of removing these types of files and even some freeware programs that help you remove these pesky undeletable files.

Error Deleting File - Access Denied

Windows 95/98/ME


If you are using Windows 95, 98, or Windows ME, the easiest way to remove an undeleteable file is to boot to a DOS prompt and manually delete the file. Before you do this, you'll want to make a note of the location of the file including the entire path to it. Follow the steps below to delete these types of files.

If you already know the path to the file, please skip to Step 7

  1. Click on Start, Find, Files and Folders
  2. Type the name of the undeletable file in the Named or Search For box 
  3. Make sure the Look In box shows the correct drive letter 
  4. Click on Find Now or Search Now and let the computer find the file 
  5. Once the file is located, right-click on it and choose properties, make a note of the file location. Usually this is something similar to

    c:\windows\system32\undeleteablefilesname.exe

  6. Close the search box  
  7. Locate a boot disk for your version of Windows, if you do not have a boot disk, follow the steps on the link below to create an emergency boot disk.

    How to Create an Emergency Boot Disk for Windows

  8. Shut down and restart your computer with the boot disk in your floppy drive. 
  9. The computer will boot to a DOS prompt that will look similar to

    c:\

  10. Type the following command and press Enter to delete the filer, substituting the phrase <path to file> with the actual path and file name you discovered in Step 5 above.

    del <path to file>

    Example: del c:\windows\undeleteablefile.exe
  11. Remove the boot disk in the floppy drive and restart your computer 
  12. The file should now be deleted.

Windows XP

In Windows XP, there are a couple ways to remove an undeleteable file, a manual way, and a couple automated ways using some freeware programs. First, I'll show you the manual way.

Manual Method

If you already know the path to the file, please skip to Step 7

  1. Click on Start, Search, All Files and Folders
  2. Type the name of the undeletable file in the box shown 
  3. Make sure the Look In box shows the correct drive letter 
  4. Click Search and let the computer find the file 
  5. Once the file is located, right-click on it and choose properties, make a note of the file location. Usually this is something similar to

    c:\windows\system32\undeleteablefilesname.exe

  6. Close the search box  
  7. Click on Start, Run, and type CMD and Press Enter to open a Command Prompt window 
  8. Leave the Command Prompt window open, but proceed to close all other open programs 
  9. Click on Start, Run and type TASKMGR.EXE and press Enter to start Task Manager 
  10. Click on the Processes tab, click on the process named Explorer.exe and click on End Process. 
  11. Minimize Task Manager but leave it open 
  12. Go back to the Command Prompt window and change to the directory where the file is located. To do this, use the CD command. You can follow the example below.

    Example: to change to the Windows\System32 directory you would enter the following command and Press Enter

    cd \windows\system32

  13. Now use the DEL command to delete the offending file. Type DEL <filename> where <filename> is the file you wish to delete.

    Example: del undeletable.exe

  14. Use ALT-TAB to go back to Task Manager 
  15. In Task Manager, click File, New Task and enter EXPLORER.EXE to restart the Windows shell. 
  16. Close Task Manager

Windows Vista/7

Manual Method
  1. Click on Start
  2. Type CMD in the Search box
  3. Right-click on CMD and choose Run as Administrator
  4. Leave the Command Prompt window open, but proceed to close all other open programs 
  5. Right click on the Task bar and click on Task Manager
  6. Click on the Processes tab, click on the process named Explorer.exe and click on End Process. 
  7. Minimize Task Manager but leave it open 
  8. Go back to the Command Prompt window and change to the directory where the file is located. To do this, use the CD command. You can follow the example below.

    Example: to change to the Windows\System32 directory you would enter the following command and Press Enter

    cd \windows\system32

  9. Now use the DEL command to delete the offending file. Type DEL <filename> where <filename> is the file you wish to delete.

    Example: del undeletable.exe

  10. Use ALT-TAB to go back to Task Manager 
  11. In Task Manager, click File, New Task and enter EXPLORER.EXE to restart the Windows shell. 
  12. Close Task Manager

Programs to automatically delete a file

Remove on Reboot Shell Extension

This is a nice extension that loads into the right click menu. All you have to do is right-click on a file and choose "Remove on Next Reboot" and the file will be deleted the next time the computer restarts. Although it probably should only be used by more advanced computer users since it may be TOO easy to delete files using this program.

Pocket Killbox

A simple .exe file that you can use to delete undeleteable files, although the program will also delete temporary files, edit the HOSTS file, and more. A definite must have program when you are fighting an annoying spyware or adware program that won't remove.

Unlocker

Unlocker is another program that runs from the right click menu. Its simple and very effective. The website even has a side by side comparision of other programs that accomplish this task.

Using one of the three tools shown above, you should be able to remove those annoying undeleteable files once and for all.
Written by Mark Hasting





Links to Other Important Information

Support for Windows XP and Windows Vista without latest service packs ends in 2010

How to Fix 500 Internal Server Error in PHP 5.4 script

Computer shows Stop error and Continously Reboots after SP3 installed.

Product Key Does Not Match Current Windows SKU Error

Review of FastAgain PC Booster and How to Uninstall it

How to Remove MSBLAST.EXE worm

How to Remove Content Advisor Password in Internet Explorer

How to Fix Google Chrome not Opening Web Pages or Settingsnew

How to Remove Incredimail Automatically

How to Fix Problem of Limited or No Connectivity After installing Windows XP Service Pack 2

How to Recover From a Corrupted Registry in Windows XP

How to Speed Up Windows Boot Time

Acer ERecovery Service is Not Available

Acer Recovery CD Restore Failed Reason: 0xf0000051

How to Fix Problem with No Active Mixer Devices Available in Windows XP

Parents Guide to MySpace.com - a report every parent should read

Save and Restore Desktop Layout of Icons

What is Windows Genuine Advantage and How to Overcome Problems With It

Change Forgotten Administrator Password in Windows XP/2000/Vista

Not Enough Server Storage Error When Connecting to Computer on Network

Installing Windows Vista Upgrade on a Blank Hard Drive

How to Delete Your Windows Vista Logon Password

Remove Unwanted Icons from the Windows Vista Welcome Center

Cannot Connect to Network Printer with Windows Vista

How to Wipe, Delete, Degauss, and Destroy Data on a Hard Drive

Fixing RTHDCPL.EXE - Illegal System DLL Relocation Error in Windows XP

How to Fix Blank or Missing Title Bar in IE9

Unable to Open New Tab in IE9 - Spinning Favicon

Fix 404 Errors for /apple-touch-icon-precomposed.png and /apple-touch-icon.png

What is the Config.Msi folder and Can I Delete It?

Flash Player Installation Issues

How to Set Yahoo Mail as your Default Email Program

Unknown File in Winsock LSP - NWPROVAU.DLL - Can it be Removed?

How to Delete a Service in Windows Vista

How to Disable the On-Screen Keyboard in Windows Vista

Make Disk Cleanup Run Faster

What is CTFMON.EXE and How Can I Remove It

How to Export MSN Favorites to Internet Explorer

How to Fix Registry Editing Has Been Disabled By Your Administrator Error

How to Change Default Editor in Windows and Fax Viewer

How to Fix Problem when Windows Security Center reports multiple antivirus programs installed

How to Fix Problem when Windows Updates will download but will not install

How to Fix Problem when Windows Automatic Updates Service wont Start

Cannot Download Files With Internet Explorer

How to Keep Your Computer Up-to-Date

How to Fix the Prompt for Click to Run an ActiveX Control on this webpage

How to Remove "This Page Contains Both Secure and NonSecure Items" Warning Message

How to Fix Problem with Blank Add/Remove Control Panel

How to Fix Windows Vista Update Error 80244019

Troubleshooting An Error Occurred During Directory Enumeration

How to View and Decipher Minidump files created by Blue Screen error messages

How to Fix BLService Error on HP Computer in Vista

Google Adsense Hijacking - How to Respond

Windows Defrag Does Not Complete

Review of BigString Recallable Email

Fix Incorrect Time Stamp on Hotmail Messages

Deleting or Editing Typed URLs in the Internet Explorer Address Bar

Belarc Advisor - Quick Computer Inventory Software

How to Get Out of Full Screen Mode in Internet Explorer

How to Correct Missing "Copy to CD" option in My Pictures Tasks

How to Fix Code 39 error with CD or DVD Drive

How to Fix Problems When Windows Installer Popups Error With Missing .MSI Files

How to Fix Problems When Network Setup Wizard and Network Connections Won't Open

How to Fix Problems with Windows Help Errors

How to Delete Individual Entries from Run Command History

Foxit - Adobe Reader Alternative

How to Fix Autochk Program Not Found error

Difference between Master/Slave and Cable Select on a Hard Drive

How to Use Microsoft SyncToy to backup your important files

How to Delete Temporary Internet Files, Cookies, and History files

Review of PCDecrapifer Software Removal Tool

How to Fix Security Flaw in Adobe Reader

Computer Speakers Sound like Chipmunks

How to SVCHOST.EXE Application Error 0x745f2780

Troubleshooting the Unmountable Boot Volume Error in Windows XP

How to Disable, Uninstall, and Remove Windows Messenger instant messaging from Windows XP

How to Remove Windows Messenger in Windows XP

Free DVD Decoder Software and Help

Free CD Burning Software and Help

How to Use Remote Desktop to Access Multiple Computer on Your LAN

HijackThis Tutorial for removing Spyware

Review of Adsense Detective, Getting Stats and Results from Adsense

How to Disable System Restore in Windows ME or Windows XP

How to Uninstall Internet Explorer 7

How to Install NetBEUI in Windows XP

What is the KB891711.exe file in Windows 98 or Windows ME?

How to Troubleshoot and Solve USB Device Error Code 10

Spooler Subsystem App has encountered a problem and needs to close Error and How to Fix it

How to Fix Problem opening Microsoft Outlook

How to Disable News Headlines in Netscape

How to Bring Back Missing Folders in Netscape Communicator

How to Fix Access Denied Error when Using MSCONFIG

How to Fix HPQKBFiltr.Sys Keylogger Error in Kaspersky Antivirus

How to Backup and Restore Outlook Express Mail, Address Book, Blocked Senders List and other Settings

How to Fix Error 501 Permission Denied when changing fonts in Outlook Express

What is the Tilde (~) File on my Desktop?

What is the thumbs.db file and can I remove it

Password is Not Saved in Outlook Express or Outlook in Windows XP

Allow Viewing of Attachments in Outlook Express 6

How to Fix Problem of No Spell Check in Outlook Express

How to Fix Problems Viewing or Accessing Secure Web Sites

How to Start or Boot Windows into Safe Mode

What is the Winmail.dat file attached to emails?

How to Correct Unreadable Fonts in Norton Antivirus or Norton Systemworks

How to correct issue with No Visible Menu Bar or Tabs in Windows XP Task Manager

How Disable/Enable the Windows XP Welcome Screen

How to Fix RTLGINA2.DLL error with Windows XP Welcome Screen and Netgear WG111

How to Fix Windows Update Error 0x80070420

PopUp Ad Removal Software and Help

Review of ErrorNuker program to identify and fix problems with the Windows Registry

Spyware and Adware Removal Help

Review of Netflix Online DVD Rental

Recommended Software for PC Hell Visitors