Solved

# Unable to delete long file names in W2K

Posted on 2003-11-08
227 Views
Within the directory "C:\Documents and Settings\Administrator\Local Settings\Temp\Temporary Internet Files\Content.IE5" there are 4 directories (4FSJG5SX, 4PINGTQR, FZ4YAXNJ, KTM7K5EZ). Within  each of these directories there is a file that cannot be deleted, renamed and properties cannot be obtained. Any ideas. I cannot use "Disk Cleanup" because of these files. Thank you, Jeff
0
Question by:jodell66

LVL 44

Accepted Solution

CrazyOne earned 84 total points
ID: 9708533
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
tree.

/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
http://support.microsoft.com/default.aspx?scid=kb;en-us;120716

BEGIN ARTICLE

--------------------------------------------------------------------------------

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

SUMMARY
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:

DEL PR?.*

-or-

DEL LPT?.*

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:
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. END ARTICLE 0 LVL 1 Assisted Solution nurho83 earned 83 total points ID: 9708717 Another way might be to go in to the default share and see if you can delete them that way. In your case you'd browse to \\computername\c$\Documents and Settings\Administrator\Local Settings\Temp\Temporary Internet Files\Content.IE5 and see if you can delete them this way.  It's worked for me in the past.

Jon Lewis
0

LVL 8

Expert Comment

ID: 9710446
You Cannot Delete a File or a Folder :

SUMMARY
You may not be able to delete a file or a folder on an NTFS file system volume. This article describes why you may not be able to delete a file or a folder on an NTFS volume and how to address the different causes to resolve this issue.
NOTE: Internally, NTFS treats folders as a special type of file. Therefore, the word "file" in this article indicates either a file or folder.
Cause 1: .............
Cause 2: .............
Cause 3: .............
Cause 4: Files Exist in Paths That Are Deeper Than MAX_PATH Characters

You may not be able to open a file if there are issues with the file path.
Resolution 1: Use an Auto-Generated 8.3 Name to Access the File
To resolve this issue, you may want to use the auto-generated 8.3 name to access the file. This resolution may be the easiest resolution if the path is deep because the folder names are too long. If the 8.3 path is also too long or if 8.3 names have been disabled on the volume, go to Resolution 2.

For additional information about disabling 8.3 file names on NTFS volumes, click the article number below to view the article in the Microsoft Knowledge Base:
121007 How to Disable the 8.3 Name Creation on NTFS Partitions

Resolution 2: Rename or Move a Deep Folder
To resolve this issue, rename the folder so that the target files that are deeper than the MAX_PATH no longer exist. If you do so, start at the root folder (or any other convenient place), and then rename folders so that they have shorter names. If this step does not resolve this issue (for example, if a file is more than 128 folders deep), go to Resolution 3.
Resolution 3: Use a Network Share That Is As Deep As the Folder
If Resolution 1 or Resolution 2 is not convenient or does not resolve the issue, create a network share that is as deep in the folder tree as you can, and then rename the folders by accessing the share.
Resolution 4: Use a Tool That Can Traverse Deep Paths
Many Windows programs expect the maximum path length to be shorter than 255 characters; therefore, these programs only allocate enough internal storage to accommodate these typical paths. NTFS does not have this limit and it is capable of accommodating much longer paths.

You may experience this issue if you create a share at some point in your folder structure that is already fairly deep, and then create a deep structure below that points by using the share. Some tools that operate locally on the folder tree may not be able to traverse the entire tree starting from the root. You may have to use these tools in a special way so that they can traverse the share. (The CreateFile API documentation describes a method to traverse the entire tree in this situation.)

Typically, you can manage files by using the software that creates them. If you have a program that can create files that are deeper than MAX_PATH, you can typically use that same program to delete or manage the files. You can typically delete files that are created on a share by using the same share.

http://support.microsoft.com/default.aspx?scid=kb;en-us;320081
0

LVL 7

Assisted Solution

wtrmk74 earned 83 total points
ID: 9745346
Delete files from Safe Mode - restart and F8 when WIN2K starts to load
Empty Recycle bin in Safe Mode
Restart

these files and folders are perfectly safe to delete, yet you will recieve a message saying thet they are system files.....ignore and proceed with deletion.

This is a history cache directory of gif, jpeg, bitmaps, and html pages, the Folders will be regenerated automatically when you browse with internet explorer again.

wtrmk74
0

LVL 7

Expert Comment

ID: 9783317
Anything?
0

LVL 7

Expert Comment

ID: 9842997
jodell66
We have not heard from you at all!

:)
0

LVL 7

Expert Comment

ID: 9900636
Hello out there ?
0

LVL 7

Expert Comment

ID: 9961735
No comment from Jodell66

I feel a point split is appropriate since many solutions were given without response from Jodell66

0

Author Comment

ID: 25042921
Great Suggestions and most I have tried. Finally resolved the issue by using "one of THOSE" programs "SpeedUpMyPC3". It actually works and didn't cause pop-ups and all that other stuff that stuff that i've experienced in the past.
0

## Featured Post

Question has a verified solution.

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

### Suggested Solutions

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
An article on effective troubleshooting
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…