# Windows 7 Delete Recursive Folder [duplicate]

``````D:\>rmdir /S default
default, Are you sure (Y/N)? y
default\default\default\default\default\default\default\default\default\default\default\default\default\default\default\default\default\default\default\default\
default\default\default\default\default\default\default\default\default\default\default - The system cannot find the path specified.
``````

I've also tried Unlocker and various other tools. Can't get rid of this folder. I also tried moving it to another drive then format, no luck.

-

## marked as duplicate by Synetech, gronostaj, Mokubai♦, Ƭᴇcʜιᴇ007, HennesAug 31 '13 at 15:58

The thread How do I delete a folder which is nested quite deep and avoid "File name too long"? addresses this extensively. – Synetech Aug 30 '13 at 19:23

your path name is to long.

try `subst x: "default\default" (include the full path and about half the number of "default" then change to x: and try to delete the default folder there, then go back to the root default folder and delete those.

this way you shorten the full path, and windows can delete those folders

-
Tried that, and with up to 5 recursive subst. It's still too long. – Mango Dec 20 '10 at 15:12
Haha, kept going and on the 6th it worked :). Thanks – Mango Dec 20 '10 at 15:14
nice, 5% inspiration, 95% perspiration :) – KutscheraIT Dec 20 '10 at 15:17

Boot with a bootable Unix/Linux distribution and delete that Windows folder from the Unix/Linux OS.

-

Open up notepad and copy and paste the following:

``````FOR /L %%1 IN (1,1,50) DO ren test 1&cd 1
``````

Presuming the folder is still located on the `D` drive, save this file as `renamer.bat` (or anything you want - `.BAT` is the important part).

Go to the command prompt and go to the root of the `D` drive, and type `renamer` and the batch file should launch and work its way through renaming each folder to something shorter, you should then be able to delete them.

Hope this helps.

-

So I had the same problem, but my folders were about 250 deep, so the subst didn't work for me... Plus they were hidden system folders. I ended up just creating a folder with a simple text file in it, and using `robocopy /purge [FOLDER CONTAINING TEXT FILE] [FOLDER CONTAINING RECURSIVE FOLDERS]`. I had to run this a half dozen times, as robocopy overlapped itself, I guess, but it worked.

-