[Scriv3/Win] exported folders with space at end of name cannot be deleted

hi, I am on Win11, Scriv3, and a painful problem is that enclosing folders exported through Export [txt] are badly created and undeletable if they have a space at the end of the folder name in the binder. Anyone know how to delete them? chkdsk no, lockhunter, no. They are just screwed up permanent residents of my HD, thx, David

Hi.

I’ve had the same issue in the past.

… Solution below

@gvdv summarized the fix :

1 Like

First-off CMD must be run as an Administrator. (Click Start, type CMD, select Run As Administrator, User Account Control will prompt you, so click Yes, and the Administrator: Command Prompt window opens.)
If the above by @Vincent_Vincent doesn’t work, e.g. if your folder names in Scrivener are longer than one word, use: rd "\?\C:\Users\YOURUSERNAME\Selected Folder\Ex-Scriv Folder Name\Ex-Scriv Sub-Folder Name " /s /q.
By way of example, say you exported the Get Oriented folder in Scrivener (and had a space after the name before exporting) to Documents in Windows, and Get Oriented is a sub-folder of The Basics folder.
The command would be: rd "\?\C:\Users\YOURUSERNAME\Documents\The Basics\Get Oriented " /s /q. Note the erroneous space is included and the closing quotation mark.
It will remove the deepest folder only with the space after it.
In this example, you’d then need to run: rd “\?\C:\Users\YOURUSERNAME\Documents\The Basics” /s /q, as you would not be able to simply delete the next level up folder you exported either.