Deleting a directory/folder with a trailing space

C

Christoph

In using a utility to help manage my music collection, it's created a folder
I can't seem to delete. I can move files into and out of that folder but if
I try to actually move the folder itself or try to rename or delete it, I
get an error message saying:

"Cannot delete file: Cannot read from the source file or disk"

At first I couldn't figure out why I was getting that error. Just by
looking at it in the windows explorer, it didn't appear that anything was
odd about the folder. However, upon further investigation, I fould that the
name of the folder is:

"The Black "

As you can see, it has a trailing space. As I mentioned above, I've tried
to rename the folder, I've tried to delete the folder but all attempts end
with the above error. I've also tried deleting/renaming the folder from the
command prompt. The commands I have tried are

del "The Black "

and

rd "The Black "

and both give me errors about how the system could not find the file
specified. Another thing I've tried to do is increase the number of
trailing spaces to see if that made any difference. It didn't.

Remembering a similar problem I had a few years ago (the name had trailing
dots as opposed to trailing space; I got rid of that directory after my HD
failed and had to replace it), I looked up the same KB article I was pointed
to in my previous post:

http://support.microsoft.com/default.aspx?scid=kb;en-us;320081#XSLTH3202121122120121120120

My problem is cause 6 so I try to proposed solution:

del "\\?\c:\my dir\The Black "

After executing that command, I don't get an error saying that the specified
file couldn't be found but it also doesn't actually delete the
folder/directory.

So I'm wondering how I can get rid of this folder short of re-formatting my
drive (not an option).

Any help would be greatly appreciated!

thnx,
Christoph
 
C

Christoph

\\?\c:\whatever
will bypass some name checking.

I indicated in my original post that I had tried the above but it didn't
work. I didn't get an error when I tried to delete the folder but also the
folder didn't actually get deleted. So adding the

\\?\

to the beginning didn't really work.

thnx,
Christoph
 
M

Mikey S.

??? Tried using [ALT]+255 (PRESS and HOLD the "ALT" key then enter: "2",
"5", "5" in sequence) to add that space to the end of the name ???
 
D

David Candy

I went to some trouble showing where you went wrong. Then I scrolled down to check something and noticed you had snipped. Find someone else to help you. I gave you technical correct info and you know better and changed what I told you to do (my way works, your way doesn't). Also you have a second error that will prevent you deleting any folder.
 
D

David Candy

If you correct your post I have pasted a transcript of me creating and deleting a folder with a trailing space into a text doc. I will delete it in 4 hours (4:40am local time when I go for a walk along beach).
 
C

Christoph

I'm curious, where did I go wrong?

You state simply:
---------------------------------------
\\?\c:\whatever

will bypass some name checking.
---------------------------------------

Umm, ok? Replacing the c:\whatever with the folder/directory name I'm
trying to delete gets me the following:

\\?\c:\my dir\The Black

So far so good. Tack on the DEL command at the beginning and press enter.
Doesn't work because it's seperating out on the spaces between my and dir
and between the and black. So I add on quotes to the beginning and end of
the statement (particularly to explicitely include the space at the end).
So that gets me the following command:

del "\\?\c:\my dir\The Black "

which looks exactly like the command I said I used in my original post. So
again, I'm curious where did I go wrong?

thnx,
Chris


"David Candy" <.> wrote in message
I went to some trouble showing where you went wrong. Then I scrolled down to
check something and noticed you had snipped. Find someone else to help you.
I gave you technical correct info and you know better and changed what I
told you to do (my way works, your way doesn't). Also you have a second
error that will prevent you deleting any folder.
 
D

David Candy

C:\Program Files\Support Tools>md "\\?\c:\cat "

C:\Program Files\Support Tools>rd c:\cat
The system cannot find the file specified.

C:\Program Files\Support Tools>rd "\\?\c:\cat "

I did give an example that incl the path.
 
D

David Candy

It's quite legal to have a trailing space.

eg

md "cat .a"

But I think it's assumed to be a typing mistake and it tries to fix as

md "cat ." or ms "cat "

creates "CAT"

--
--------------------------------------------------------------------------------------------------
Goodbye Web Diary
http://margokingston.typepad.com/harry_version_2/2005/12/thank_you_and_g.html#comments
=================================================
"David Candy" <.> wrote in message C:\Program Files\Support Tools>md "\\?\c:\cat "

C:\Program Files\Support Tools>rd c:\cat
The system cannot find the file specified.

C:\Program Files\Support Tools>rd "\\?\c:\cat "

I did give an example that incl the path.
 
C

Christoph

Del does not delete folders. RD does.

Fair point. And I don't think I tried the RD with the \\?\ notation. I
tried it w/o but not with.

thnx,
Christoph
 

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