RoboCopy seems particularly good at addressing folders/paths verbatim, so you could make an empty folder alongside the parent of the folder that has your erroneously named folder and then copy the empty folder to be the parent folder path and specify the PURGE option, which will purge the other entries in the destination folder. Hopefully you will also ensure that only bad folders are there
In summary, you want to copy 0 files into the folder that houses your bad folder, and specify /purge so that the operation clears out anything else in the folder (including your bad folder)
Confused? Then an example will surely help. Suppose you have:
C:\path\leading-to-a\folder-with-space \
Run these commands:
cd c:\path\
mkdir empty
robocopy empty leading-to-a /purge
robocopy will copy the empty folder to the leading-to-a folder, and purge the other entries in the leading-to-a folder, one of which is your folder with a trailing space:
ROBOCOPY :: Robust File Copy for Windows
Started : Thu Jan 01 00:00:00 1970
Source : C:\path\empty\
Dest : C:\path\leading-to-a\
Files : *.*
Options : *.* /COPY:DAT /PURGE /R:1000000 /W:30
0 C:\path\empty\
*EXTRA Dir -1 C:\path\leading-to-a\folder-with-spaces \
Total Copied Skipped Mismatch FAILED Extras
Dirs : 1 0 1 0 0 1
Files : 0 0 0 0 0 0
Bytes : 0 0 0 0 0 0
Times : 0:00:00 0:00:00 0:00:00 0:00:00
Ended : Thu Jan 01 00:00:00 1970
Warning:
Make sure that anything you want to keep is moved out of the leading-to-a folder first!
+1 for suggesting also The Linux solution – Sekhemty – 2014-12-27T13:01:41.480
3Backslash method worked for me on Windows 10 – KnightHawk – 2016-12-21T15:57:58.563
3Deleting using the 8.3 names worked. Thanks – SuperFurryToad – 2010-10-11T15:18:13.250
Good ol DOS legacy. – surfasb – 2011-04-02T15:41:38.673
"mydomain.com " as a folder. DOS thought the 8.3 filename was "mydoma~1.com". But it worked. Super thanks! – Coomie – 2011-12-08T06:09:38.987