Sign in with
Sign up | Sign in
Your question

Source Path too Long

Last response: in Windows 7
February 12, 2010 10:23:36 PM

I was using a YAMJ program for creating a set of HTML pages which dump into a folder I specify, but it actually created 30 or so folders within folders of the same name.

If I try to delete them all, it first acts like it's going to, but then I get a "Source Path Too Long" error, or sometimes a "Destination Path Too Long" error. it says to shorten the file name, but the problem isn't the file name being too long, it's the path because of what it did (i.e. it buried folder into folder into folder 30 deep).

Please, how do I delete this mess? it seems like a windows glitch. There must be some way to make Windows able to delete these. I've tried moving and renaming the folders/files, but nothing works.

More about : source path long

a b $ Windows 7
February 15, 2010 12:59:16 PM

One way I've done it is to just drill down into the almost endless path of directories and start moving some of them out to the root directory and then delete them that way. It takes awhile, but that is the only way I've been able to do it.

Pretty stupid though, huh? You can create the directory paths that are too long, but you can't delete them without moving them. :heink: 
a c 209 $ Windows 7
February 15, 2010 4:25:22 PM

It really isn't about the depth of the folders, it's the fact that by the time you get to the bottommost folder level the file name at that level has gotten so long that it exceeds the system's maximum file name length (normally 260 characters).

There's a trick you can use to get the system to handle longer filenames. Try opening up a command prompt window and deleting the folder tree using a filename that starts with "\\?\d:\" instead of "d:\". For example if the top level of the directory tree you want to remove is:


then try using:

rmdir \\?\d:\MyDocs\DeepTree /s /q
Related resources
Can't find your answer ? Ask !
August 5, 2010 1:25:33 AM

For example if the top level of the directory tree you want to remove is:
then try using:

rmdir \\?\d:\MyDocs\DeepTree /s /q

Fantastic sminlal-
Its quicker and easier for larger directories than explorer
what's going to happen when the DOS boys retire ?
the only option will be an ipad app !

Create a .batch file deeptree.bat
rmdir \\?\d:\MyDocs\DeepTree /s /q

Use Windows exlplorer to find offending directory
copy/paste from the Address Bar into the bat file

Save Exit Run
a b $ Windows 7
October 27, 2010 12:08:13 AM

This topic has been closed by Buwish