Unable to delete folder in Windows XP

S

soumenbhatt

I had installed Tomcat in my WinXP SP2 machine. Something went wrong
and although Tomcat is working fine, it created a recursive folder
structure
TomcatJSPExample\build\web\WEB-INF\classes\TomcatJSPExample\build\web\...
etc. Due to this, some of the inner folders are having a path too long
for Windows to access. So Windows can neither access them, nor can
delete them.

I would very much like to delete this inner forders, which are
basically of no use (how did they come to exist in the first place?).
However, I have been unable to delete these folders. Every time I try
to delete them, I get the following error:

Cannot delete schemas: The file name you specified is not valid or too
long.
Specify a different file name.

I have tried doing it with Windows explorer, in DOS (does not give any
error in DOS, but neither does it delete the folders), and also
programmatically using .Net. Has anyone faced this issue? Any known
resolution to this?

Thanks a lot in advance for any kind of help on this.
 
W

Wesley Vogel

Path Too Long

To work around this problem, reduce the length of the path to less than 256
characters.

In Windows Explorer, select the folder one level above the folder that
returns the error. Right-click the folder returning the error and then click
Rename. Rename the folder to reduce the number of characters used in the
folder name.

Rename the folder so that the target files that are deeper than the MAX_PATH
no longer exist. If you do this, start at the root folder (or any other
convenient place), and then rename folders so that they have shorter names.

Rename subfolders in the path to a file so that the total path or file name
is less than the max_path setting or 256 characters. Start with subfolders
that are closer to the root so that you are always working with less than
256 characters.

Also see...
Files exist in paths that are deeper than MAX_PATH characters
here for other options...
You cannot delete a file or a folder on an NTFS file system volume
http://support.microsoft.com/kb/320081

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
S

soumenbhatt

That was an excellent suggestion. I renamed all the folders to single
character names, and that resolved the issue.

The first time I faced the same problem while renaming a few folders
down the line. So I started a few levels up. And it went smoothly
thereafter.

Thanks a lot for the suggestion. Really appreciate the help.

Thanks,
Soumen
 
W

Wesley Vogel

Glad to hear it. Keep having fun.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top