Logo Background

Error deleting file or folder: Cannot find the specified file

  • I am having difficulty deleting a 2 KB text file copied from a Windows 98 to Windows XP machine. Whenever attempting to delete the file the following error appears: ‘Error deleting file or folder: Cannot find the specified file. Make sure you specified the correct path and file name’. Deleting the file at the command prompt, renaming, and restoring using ’save all’ makes no difference. The only thing I can do is move the folder where the file is located (and I did try to move it to the Recycling Bin with no luck.). Running ScanDisk did not pick up any errors. The computer is running Windows XP with an NTFS file system.

    If the file has a long filename (i.e., longer than 8 characters) there is another procedure we can try to delete the file from the command prompt. Go to the ‘Start’ menu > ‘Run’ and type ‘cmd’ then click OK. Change to the directory containing the problematic file, then type the command ‘DIR /X /A’ (without the quotes). This will produce a list of the short file names (any files/folders which have file names longer than 8 characters will be truncated) for files and folders in that directory. Now, try to delete the file using the command DEL . For example, if the file was named ‘this is a test.txt’ then the truncated version DIR /X /A returns is ‘thisis~1.txt’. So, you would type the command ‘DEL thisis~1.txt’.

    Should you continue to have problems, try the following. Close any open programs. Then, open a Command Prompt window and leave the window open (do not minimise the window). Press CTRL-ALT-DEL to open the Windows Task Manager. Click the ‘Processes’ tab and find the ‘explorer.exe’ process. Select this process then click ‘End Process’. This will kill the Windows shell (i.e., Start menu). Leave the Task Manager open and go to the Command Prompt window. Delete the problem file by using the DEL command. Then, swap back to the Task Manager and go to the ‘File’ menu > ‘New Task (Run’¦)’. Type ‘explorer’ (without the quotes) and click OK. This will restart the Windows GUI shell.

    There is a utility which you can download to delete otherwise undeletable files. This is called Delete FXP Files and is available from www.jrtwine.com/Products/DelFXPFiles/index.htm. The program comes in several versions: free, personal, professional, server, and enterprise. The different versions have different functionality. The free edition has the delete functionality so it may be useful to you. I have not used this software, so I cannot give any opinion on how it works. I would be interested to hear if it can fix your problem.

    All else failing, you may wish to have a look at the Microsoft Knowledge Base article ‘You Cannot Delete a File or Folder’ at support.microsoft.com/?id=320081. However, I don’t think this information will be applicable in your case.

Leave a Comment
Hi there. If this is the first time you are posting a comment it will not appear immediately, but needs to be approved. This is necessary in order to combat comment spam. However, once you have submitted a comment (which is subsequently approved) you do not need to go through this process again - the site remembers who you are and auto-approves your comments. Nifty eh? Anyway, sorry about the inconvenience that this may cause for your first comment post.