How do I delete a Folder with spaces - I can't backup my docs folder

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
ghawell99
Posts: 1
Joined: 10 Oct 2021 12:55

How do I delete a Folder with spaces - I can't backup my docs folder

#1 Post by ghawell99 » 10 Oct 2021 13:33

Need help please

Trying to delete a folder or rename

c:\users\Peachtree 2nd\Documents\4638Eberrline Court Stone Mountain GA 30083

[4638Eberrline Court tone Mountain GA 30083 ]

At the end of 30083 it has a ""space"" - can't delete the file

I am trying to backup my Documents folder. When it get to this file the backup STOPS and won't go any farther.

Thank you for ""ANY"" help.

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: How do I delete a Folder with spaces - I can't backup my docs folder

#2 Post by aGerman » 10 Oct 2021 16:29

Prepending \\?\ should do the trick.

Code: Select all

rd /s /q "\\?\c:\users\Peachtree 2nd\Documents\4638Eberrline Court Stone Mountain GA 30083 "
This is for deleting, however renaming should work as well.

Code: Select all

ren "\\?\c:\users\Peachtree 2nd\Documents\4638Eberrline Court Stone Mountain GA 30083 " "4638Eberrline Court Stone Mountain GA 30083"
Steffen

Post Reply