Tuesday, May 4, 2010

How to Delete Undeletable Files in Windows

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.
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.

  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


Catch the changing security environment Get it now.

1 comment:

  1. http://longPathTool.com

    Do you have error messages?, like :
    Path too long.
    Error cannot delete file: cannot read from source file or disk
    Cannot delete file: Access is denied
    There has been a sharing violation.
    Cannot delete file or folder The file name you specified is not valid or too long. Specify a different file name.
    The source or destination file may be in use.
    The file is in use by another program or user.
    Error Deleting File or Folder
    Make sure the disk is not full or write-protected and that the file is not currently in use.
    Error Copying File or Folder.
    Cannot remove folder.
    The filename or extension is too long.
    Path too deep.
    Could not find this item.
    Filename is not valid.
    The file could not be accessed.
    The path you entered, is too long. Enter a shorter path.
    File Name could not be found. Check the spelling of the filename, and verify that the file location is correct.

    http://longPathTool.com

    ReplyDelete