Can't delete/rename folder as the name ends with space

D

Don Wiss

Due to a bug in one of my programs a folder got renamed to a name with a
space at the end. I can't delete, move, or rename this folder. I can move
the parent folder and it comes along. So I have moved it off to a problem
area and renamed the parent. But I'd still like to get rid of it. I've
booted my machine. I'd gone to the command prompt and tried putting double
quotes around it plus a trailing space. I've tried tying to it under
program control (with the trailing space). Nothing works. The error is
always "The system cannot find the file specified."

Don <www.donwiss.com> (e-mail link at home page bottom).
 
N

Nightowl

Don Wiss said:
Due to a bug in one of my programs a folder got renamed to a name with a
space at the end. I can't delete, move, or rename this folder. I can move
the parent folder and it comes along. So I have moved it off to a problem
area and renamed the parent. But I'd still like to get rid of it. I've
booted my machine. I'd gone to the command prompt and tried putting double
quotes around it plus a trailing space. I've tried tying to it under
program control (with the trailing space). Nothing works. The error is
always "The system cannot find the file specified."

Hi Don

This solution was posted by John John a couple of weeks ago and
succeeded where all else had failed :)
Open Windows Explorer and navigate to the parent folder of the
undeletable folder. Leave the Explorer window open.

Open a Command Prompt and type the partial command:

RD "\\?\

Leave the Command Prompt window open. From the opened Explorer window
grab the undeletable folder and drag it to the Command Prompt and drop
it at the end of the incomplete RD command that you typed earlier.
Complete the command by encapsulating it with a set of quotation marks
at the end of the command line. Make sure you are at the end of the
line, in case of trailing spaces.

Some folder names, when dragged and dropped into the Command Window,
will have quotes already around them and this may cause you to get a
syntax error. If that happens, just try again but leave out the quote
marks after RD and don't add an extra set at the end of the line.

Good luck! Let us know how you get on.
 
N

Newbie Coder

Don Wiss,

Try using the command prompt to rename it. Failing that, safe mode then use
the command prompt to name it. You're better off using the 8.3 naming
convention when using the prompt

I hope this solves your problem,
 
D

Don Wiss

This solution was posted by John John a couple of weeks ago and
succeeded where all else had failed :)


Some folder names, when dragged and dropped into the Command Window,
will have quotes already around them and this may cause you to get a
syntax error. If that happens, just try again but leave out the quote
marks after RD and don't add an extra set at the end of the line.

Yep. It worked. And yes I had to remove the first quote that appeared after
the command above that I typed. Thanks. Now there is no way that I would
have figured this syntax out by myself!

Don <www.donwiss.com> (e-mail link at home page bottom).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top