file cannot be deleted


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?

Who is Participating?

Improve company productivity with a Business Account.Sign Up

CrazyOneConnect With a Mentor Commented:
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
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.
RogerianusAuthor Commented:
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.
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to and use offer code ‘EXPERTS’ to get 10% off your first purchase.

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.
RogerianusAuthor Commented:
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.
RogerianusAuthor Commented:
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.
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.