Windows 7 Delete Recursive Folder

06
2014-04
  • Mango
  • Answers
  • Weltenwanderer

    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

  • Mehper C. Palavuzlar

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

  • William Hilsum

    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.

  • Veritas

    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.


  • Related Question

    Can't delete folder in Windows 7
  • user18526

    I'm trying to delete a folder in Windows 7 and get a perplexing error message: "Could not find this item: This is no longer located in G:\Graphics. Verify the item's location and try again.

    I can see the folder -- I can find it. I just can't delete it.

    I also get a second error message (sometimes) when I click on the folder: G:\Graphics 2009-11-17 refers to a location that is unavailable...this information might have been moved to a different location.

    I'm using Windows 7; this folder is on an external hard drive. I've emptied the folder (there were items in it); I've scanned that external hard drive for errors. Trying to rename the folder yields the same enigmatic error message.

    Is there a way to delete this folder?


  • Related Answers
  • harrymc

    Open Command Prompt, use dir /x to get the 8.3 name of the folder which cannot be deleted, and then use rd with the 8.3 name of the folder, and it should be gone.

    If this doesn't work, ensure first that the folder is empty.

  • detj

    yes. Boot into Linux using any of the live CDs, I would recommend Ubuntu and delete that damn folder

  • 13east

    You can try Unlocker if you experience these kind of issues in the future. Windows is known to lock certain files/folder and refuse access to edit/delete them from time to time; Unlocker is a handly little program that can help rename/move/delete unresponsive files/folders.

  • KCotreau

    Try this:

    Do a dir /x /ad to get the 8.3 name of the folder (it will look like docume~1), then do a rd folder* /s (you may even truncate it more like rd fol* /s if there are no other directories with similar names).

    If this does not work, the run chkdsk /f (maybe a couple of times even, but check your Event Viewer>Windows Logs>Application Log to see if there are still a lot of errors. http://www.sevenforums.com/tutorials/96938-check-disk-chkdsk-read-event-viewer-log.html screenshots 6 or 8). Then try the rd command with the 8.3 again as above.

  • DragonLord

    Do not forget if the file type has been corrupted, the extension may not appear in the 8.3 name, if for example you have something like this:

    • FILENAME.EXT
    • FILENAME.EXT
    • FILENAME
    • FILENAME.EXT

    and the one missing its extension is the one you can't delete, use the del command and the file name and add four spaces, then hit Enter.

    For example:

    del FILENAME__________
    

    The ____________ at the end there is just to show the four spaces added.

    This just worked for me on a file that was corrupted during download.

  • Scott

    Try restarting your computer, and then deleting the folder.

    When you restart your computer the folder might even be gone. It might have already been deleted, but Explorer was showing a cached image.

  • Andrea
    1. Download 7zip
    2. Browse to folder
    3. Right-click rename (successful)
    4. Close 7zip
    5. Browse to folder > right-click delete