How can I delete a Windows folder with a trailing space in its name?
Asked by
MellowPine42
I'm using Windows 11 and have a folder on the D: drive named `Ready_2 ` with a space at the end. File Explorer and another file manager can display it, but Windows says it can't find the folder when I try to rename or delete it. What's the correct way to remove it?
Answers
You can also try renaming the folder first, but Explorer may report that the item doesnโt exist even though it is visible. If the drive or directory listing looks stale, restart Windows and check it with `cd /d D:` followed by `dir`. However, the extended-path `rd` command is the reliable fix for a folder with a space at the end.
Reply to this answer
A trailing space makes the folder awkward for normal Windows tools because they usually normalize the name. From an elevated Command Prompt, use the extended path prefix and remove the directory recursively: `rd /s /q "\?D:Ready_2 "`.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions