Quantcast
Channel: Windows 7 Miscellaneous forum
Viewing all articles
Browse latest Browse all 11372

Delete "Path too long" working solution, includes long path without any files or junction loop

$
0
0

Problem: A too long path to delete, like path\path\path > 16000 characters. rd /s /q failes. Using cygwin failes. http://support.microsoft.com/kb/320081 failes.

Solution (half of it): Use robocopy to mirror an EMPTY folder over the to-be-deleted folder.

Problem part 2: If there are only empty folders /MIR or /PURGE alone don't work, simply because /MIR ignores empty folders.

Complete solution in detail is to create a batch delete-too-long-path.cmd file containing following:

@echo off
echo I will delete:
echo %*
echo.
echo If that is wrong close this window now, else
pause
mkdir "%temp%\emptyfolder3214321"
robocopy "%temp%\emptyfolder3214321" %* /E /MIR
rd /s /q "%temp%\emptyfolder3214321"
rd /s /q %*
pause

Then drag-and-drop the path to be deleted on that batch file.

I will update my homepage http://joumxyzptlk.de with that solution soon.

Here an example of an currently running delete job. I've already renamed about 25 subfolders to "x" and moved them (therefore those three "x\") before I gave up and researched for a better way.

An example of a running robocopy-delete job


Viewing all articles
Browse latest Browse all 11372

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>