file cannot be deleted

Posted on 2002-05-25
Last Modified: 2013-12-16

In one of my temporary internet file folders there is a file with  a .htm extension that has a very very long filename.
Maybe that is the reason I cannot delete it?
I also tried deleting it by using the command prompt.
Either the delete function does not react at all, or it says 'file not found'
I cannot rename it either.

Does anyone know how I can get rid of it?

Question by:Rogerianus
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2

Expert Comment

ID: 7034341
A file with a very long file name. Have you started the machine in Safe Mode and tried deleting the file? It could be a program's data file that when running (in normal mode) locks the file down so that you get access denied errors. You can't delete, you can't rename. For example, Internet Explorer "index.dat" file.

So..try Safe Mode and post any results.

Author Comment

ID: 7034361
Also in safe mode I cannot delete the file.
I don't know if it helps you but the file is located in C:\documents and settings\adminsitrator\local settings\temp\temporary internet files\content.ie5\SP2BS9YV and is now the only file in that folder.
The properties of the file are 'not available'.
The delete button (or delete function after right clicking) just doesn't do anything, it gives no error.
It is a .htm file but when opening it just calls internet explorer with an empty screen.

Expert Comment

ID: 7034374
Can you view the source code of that htm file? I'm leaning towards it being a virus but not really sure. Dump the HTML codes here.

If your install is on FAT with basic disk, see if you can get into MS-DOS (using DOS Floppy, not cmd.exe) and navigate to that directory (using 8.3 filenames), and use del built-in function to kill that file. See if this works.
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.


Author Comment

ID: 7034408
No, I cannot edit it with Notepad and neither with CoffeeCup.
My computer is protected with AVG antivirus, for what it 's worth.
I have NTFS file system.

Now when I double click the file it goes to a website
I remember yesterday I had to reset my wallpaper because that same site had put an image on my desktop about a search engine, without asking me first.
LVL 44

Accepted Solution

CrazyOne earned 100 total points
ID: 7034432
You might want to look at this page it might have some inro about your situation.


Try this open a command window and do this

Open a CMD.EXE window.
CD to the top of the mess.
Use: DIR /X /A   to see the SHORT FILE NAMES of the files and directories there.
Use a combination of CD, RD, and DEL and the SHORT FILES names reported with DIR /X to delete your way to the bottom and then back up the tree removing the files on the way down and the directories on the way up.
Most likely there is NOT a protection issue here so you shouldn't need worry about ownership or file protections.

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

   /S      Removes all directories and files in the specified directory
           in addition to the directory itself.  Used to remove a directory

   /Q      Quiet mode, do not ask if ok to remove a directory tree with /S

This MS KB article may help


How to Remove Files with Reserved Names in Windows (Q120716)

The information in this article applies to:

Microsoft Windows 2000 , Professional
Microsoft Windows 2000 , Server
Microsoft Windows 2000 , Advanced Server
Microsoft Windows 2000 , Datacenter Server
Microsoft Windows NT Server versions 3.1 , 3.5 , 3.51 , 4.0
Microsoft Windows NT Workstation versions 3.1 , 3.5 , 3.51 , 4.0
Microsoft Windows NT Advanced Server

Because applications control the policy for creating files in Windows, files sometimes are created with illegal or reserved names, such as LPT1 or PRN. This article explains how to delete such files using the standard user interface.

NOTE : You must be logged on locally to the Windows computer to delete these files.

If the file was created on a file allocation table (FAT) partition, you may be able to delete it under MS-DOS using standard command line utilities (such as DEL) with wildcards. For example:




These commands do not work on an NTFS partition as NTFS supports the POSIX subsystem and filenames such as PRN are legal under this subsystem. However, the operating system assumes the application that created them can also delete them; therefore, you can use commands native to the POSIX subsystem.

You can delete (unlink) these files using a simple, native POSIX application. For example, the Windows Resource Kit includes such a tool, Rm.exe.

NOTE : POSIX commands are case sensitive. Drives and folders are referenced differently than in MS-DOS. Windows 2000 and later POSIX commands must use the following usage syntax:
posix /c <path\command> [<args>] IE: posix /c c:\rm.exe -d AUX.

Usage assumes Rm.exe is either in the path, or the current folder:
rm -d // driveletter / path using forward slashes / filename
For example, to remove a file or folder named COM1 (located at C:\Program Files\Subdir in this example), type the following command:
rm -d "//C/Program Files/Subdir/COM1"
To remove a folder and its entire contents (C:\Program Files\BadFolder in this example), type the following command:
rm -r "//C/Program Files/BadFolder"
Another option is to use a syntax that bypasses the normal reserve-word checks altogether. For example, you can possibly delete any file with a command such as:
DEL \\.\ driveletter :\ path \ filename
For example:

DEL \\.\c:\somedir\aux

Published Jun 3 1997 7:28AM  Issue Type  
Last Modifed Dec 22 2001 12:57PM  Additional Query Words 3.10 prodnt CON PRN AUX CLOCK$ NUL COM1 LPT1 LPT2 LPT3 COM2 COM3 COM4 winnt  
Keywords kbusage  

COPYRIGHT NOTICE. Copyright 2002 Microsoft Corporation, One Microsoft Way, Redmond, Washington 98052-6399 U.S.A. All rights reserved.


The Crazy One

Author Comment

ID: 7034444
While waiting for an answer from EE I fooled around a bit and was able to delete the file myself:  
While being in its original location, I could'nt delete it nor the folder in which it was contained.  But I could move the folder to another location (c:\), and then deletion of the folder was possible !!
I don't understand how or why but I got rid of it.
Thanks for your help.
LVL 44

Expert Comment

ID: 7034470
BTW I forgot to include the link in my comment. If you run into problems with the site then this page has some info the may be useful.

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure ( It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: : Go t…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question