After migrating Windows data, it can be a royal pain cleaning up the source data using del *.* /s /q /f, especially when the path length exceeds 260 (or thereabouts) characters. You can manually shorten the folder names and keep trying, but this may be time consuming, tiring and ultimately futile.
The simplest way I’ve found to reliably delete data, irrespective of path length, is to use robocopy.
- cd into the directory that you want to empty
- create a new empty subdirectory called empty
- rename all other adjacent folders 1, 2, 3, 4 etc if possible
- robocopy empty 1 /mir /r:1 /w:1
- repeat for each adjacent folder, 2, 3, 4 etc.