Cannot delete folder (directory)

G

Guest

I programmatically created a folder named "Backup ". Yes, an invalid
trailing blank. Trailing periods are removed but not blanks.

Windows uses it just fine placing content inside it. Chkdsk sees no problem
but I cannot delete the folder. WExplorer says it cannot read from the
source file or directory. DOS says it cannot find the name. Windows created
it but then can't handle it in any way.

How do I rename or delete this folder? I can find no way and am not new to
this game!

Thanks for any pointers for fixing this M$ bug.
 
P

Pegasus \(MVP\)

Mike Morrow said:
I programmatically created a folder named "Backup ". Yes, an invalid
trailing blank. Trailing periods are removed but not blanks.

Windows uses it just fine placing content inside it. Chkdsk sees no problem
but I cannot delete the folder. WExplorer says it cannot read from the
source file or directory. DOS says it cannot find the name. Windows created
it but then can't handle it in any way.

How do I rename or delete this folder? I can find no way and am not new to
this game!

Thanks for any pointers for fixing this M$ bug.

A few observations:
- A space anywhere in file name is not "invalid" - it is perfectly OK.
- DOS is an operating system, same as Linux or Windows.
It does not exist under Windows - you probably mean
the "Command Prompt" when you say "DOS".
- What you observe is not a Windows "bug" but probably
incorrect syntax.

To delete the offending folder, do this:
- Click Start / Run / cmd {OK}
- Type these commands:
cd /d "c:\Documents and Settings\Mike\My Documents"
(type the correct name to the parent of the problem folder)
- Type this command:
rd /s /q ^F {Enter}
(note: ^F stands for Ctrl+F. You must press Ctrl+F as
many times on the keyboard until the offending folder name
appears. Do not press Enter until you see the correct folder
name!)
 
G

Guest

Since I have been doing computers for 30 years and actually ran on DOS before
Windows came along, I still call it DOS. You can call it the Command Prompt
or the CLI or "cmd" or whatever you want but it is still DOS to me.

I have already tried to remove the directory. I am not so stupid that I did
not try this already. It does not work.

I don't know what this Ctrl+F business is about. It just puts up ^F as many
times as I press it. Never heard of this before and, it seems, neither has
DOS.

Here are the results of my trials and failures to remove this invalid
directory.

L:\rmdir ba*
^
The filename, directory name, or volume label syntax is incorrect.

L:\>rmdir /s back*
back*, Are you sure (Y/N)? y
The filename, directory name, or volume label syntax is incorrect.

L:\>rmdir backup*
The filename, directory name, or volume label syntax is incorrect.

L:\>rm /?
'rm' is not recognized as an internal or external command,
operable program or batch file.

L:\>rmdir /s /q backup

L:\>dir
Volume in drive L is RAID Mirror
Volume Serial Number is 20FB-0B9F

Directory of L:\

05/31/2006 06:16 PM <DIR> AniMusic
03/21/2007 07:01 PM <DIR> Audio Books
03/24/2007 04:07 PM <DIR> Backup
03/23/2007 08:16 PM <DIR> Backup_GOOD
12/10/2005 12:38 PM 43,008 CEU Tapes & Hours Listing.doc
04/28/2005 10:55 PM <DIR> iconmagic
03/23/2007 08:16 PM <DIR> Monthly PHPFiles Backup
10/11/2006 01:23 PM <DIR> NCLEX Install Files
01/13/2006 12:06 AM 43,008 Patient Assessment Worksheet.doc
06/29/2005 07:15 PM <DIR> PHP Graphics & Web Files
10/19/2006 02:20 PM <DIR> PHP Work Done for Others
01/02/2007 07:25 PM <DIR> Scanned Records & Tracking
02/10/2007 05:41 PM <DIR> School Videos in mp3
03/27/2007 06:25 PM 80 Try.bat
12/09/2005 05:22 PM 68,608 UNIT 4.doc
03/27/2007 06:07 PM <DIR> zPersonal and Historical
4 File(s) 154,704 bytes
12 Dir(s) 64,576,397,312 bytes free

L:\>rmdir /s /q backup
The system cannot find the file specified.

L:\>rmdir /s /q backup
The system cannot find the file specified.

L:\>dir
Volume in drive L is RAID Mirror
Volume Serial Number is 20FB-0B9F

Directory of L:\

05/31/2006 06:16 PM <DIR> AniMusic
03/21/2007 07:01 PM <DIR> Audio Books
03/24/2007 04:07 PM <DIR> Backup
03/23/2007 08:16 PM <DIR> Backup_GOOD
12/10/2005 12:38 PM 43,008 CEU Tapes & Hours Listing.doc
04/28/2005 10:55 PM <DIR> iconmagic
03/23/2007 08:16 PM <DIR> Monthly PHPFiles Backup
10/11/2006 01:23 PM <DIR> NCLEX Install Files
01/13/2006 12:06 AM 43,008 Patient Assessment Worksheet.doc
06/29/2005 07:15 PM <DIR> PHP Graphics & Web Files
10/19/2006 02:20 PM <DIR> PHP Work Done for Others
01/02/2007 07:25 PM <DIR> Scanned Records & Tracking
02/10/2007 05:41 PM <DIR> School Videos in mp3
03/27/2007 06:25 PM 80 Try.bat
12/09/2005 05:22 PM 68,608 UNIT 4.doc
03/27/2007 06:07 PM <DIR> zPersonal and Historical
4 File(s) 154,704 bytes
12 Dir(s) 64,576,397,312 bytes free

L:\>rmdir "backup "
The system cannot find the file specified.

L:\>rmdir "backup*"
The filename, directory name, or volume label syntax is incorrect.

L:\>rmdir backup*
The filename, directory name, or volume label syntax is incorrect.

L:\>rmdir backup
The system cannot find the file specified.

L:\>dir
Volume in drive L is RAID Mirror
Volume Serial Number is 20FB-0B9F

Directory of L:\

05/31/2006 06:16 PM <DIR> AniMusic
03/21/2007 07:01 PM <DIR> Audio Books
03/24/2007 04:07 PM <DIR> Backup
03/23/2007 08:16 PM <DIR> Backup_GOOD
12/10/2005 12:38 PM 43,008 CEU Tapes & Hours Listing.doc
04/28/2005 10:55 PM <DIR> iconmagic
03/23/2007 08:16 PM <DIR> Monthly PHPFiles Backup
10/11/2006 01:23 PM <DIR> NCLEX Install Files
01/13/2006 12:06 AM 43,008 Patient Assessment Worksheet.doc
06/29/2005 07:15 PM <DIR> PHP Graphics & Web Files
10/19/2006 02:20 PM <DIR> PHP Work Done for Others
01/02/2007 07:25 PM <DIR> Scanned Records & Tracking
02/10/2007 05:41 PM <DIR> School Videos in mp3
03/27/2007 06:25 PM 80 Try.bat
12/09/2005 05:22 PM 68,608 UNIT 4.doc
03/27/2007 06:07 PM <DIR> zPersonal and Historical
4 File(s) 154,704 bytes
12 Dir(s) 64,576,397,312 bytes free

L:\>rmdir /s backup
backup, Are you sure (Y/N)? y
The system cannot find the file specified.

L:\>dir
Volume in drive L is RAID Mirror
Volume Serial Number is 20FB-0B9F

Directory of L:\

05/31/2006 06:16 PM <DIR> AniMusic
03/21/2007 07:01 PM <DIR> Audio Books
03/24/2007 04:07 PM <DIR> Backup
03/23/2007 08:16 PM <DIR> Backup_GOOD
12/10/2005 12:38 PM 43,008 CEU Tapes & Hours Listing.doc
04/28/2005 10:55 PM <DIR> iconmagic
03/23/2007 08:16 PM <DIR> Monthly PHPFiles Backup
10/11/2006 01:23 PM <DIR> NCLEX Install Files
01/13/2006 12:06 AM 43,008 Patient Assessment Worksheet.doc
06/29/2005 07:15 PM <DIR> PHP Graphics & Web Files
10/19/2006 02:20 PM <DIR> PHP Work Done for Others
01/02/2007 07:25 PM <DIR> Scanned Records & Tracking
02/10/2007 05:41 PM <DIR> School Videos in mp3
03/27/2007 06:25 PM 80 Try.bat
12/09/2005 05:22 PM 68,608 UNIT 4.doc
03/27/2007 06:07 PM <DIR> zPersonal and Historical
4 File(s) 154,704 bytes
12 Dir(s) 64,576,397,312 bytes free

L:\>rmdir /s "backup "
backup , Are you sure (Y/N)? y
The system cannot find the file specified.

L:\>dir
Volume in drive L is RAID Mirror
Volume Serial Number is 20FB-0B9F

Directory of L:\

05/31/2006 06:16 PM <DIR> AniMusic
03/21/2007 07:01 PM <DIR> Audio Books
03/24/2007 04:07 PM <DIR> Backup
03/23/2007 08:16 PM <DIR> Backup_GOOD
12/10/2005 12:38 PM 43,008 CEU Tapes & Hours Listing.doc
04/28/2005 10:55 PM <DIR> iconmagic
03/23/2007 08:16 PM <DIR> Monthly PHPFiles Backup
10/11/2006 01:23 PM <DIR> NCLEX Install Files
01/13/2006 12:06 AM 43,008 Patient Assessment Worksheet.doc
06/29/2005 07:15 PM <DIR> PHP Graphics & Web Files
10/19/2006 02:20 PM <DIR> PHP Work Done for Others
01/02/2007 07:25 PM <DIR> Scanned Records & Tracking
02/10/2007 05:41 PM <DIR> School Videos in mp3
03/27/2007 06:25 PM 80 Try.bat
12/09/2005 05:22 PM 68,608 UNIT 4.doc
03/27/2007 06:07 PM <DIR> zPersonal and Historical
4 File(s) 154,704 bytes
12 Dir(s) 64,576,397,312 bytes free

L:\>
 
P

Pegasus \(MVP\)

Sorry, I omitted one line from my recipe. It's a line that
distinguishes the Command Prompt from DOS. It's called
"File/Directory completion". The line should be

cmd /f:blush:n
followed by
rd /s /q ^F {Enter}

Since you're so fond of DOS, try some of these very basic
DOS commands in the WinXP Command Prompt:
sys C:
fdisk

They don't seem to work. Now look for the standard DOS
boot files. They have been around since DOS 1.0, without
exception:
c:\msdos.sys
c:\io.sys

Now try some of these Windows command in a real DOS
environment, e.g. after booting the machine with a DOS
boot disk from www.bootdisk.com:

set /p name=Please enter your name:
for /F %a in (c:\boot.ini) do @echo %a

DOS can't to any of this, because it's strictly Windows stuff.
However, you can still call the Command Prompt "DOS" even
though it lacks the very basic elements of DOS. It's your choice.
 
N

Nightowl

I programmatically created a folder named "Backup ". Yes, an invalid
trailing blank. Trailing periods are removed but not blanks.

Windows uses it just fine placing content inside it. Chkdsk sees no problem
but I cannot delete the folder. WExplorer says it cannot read from the
source file or directory. DOS says it cannot find the name. Windows created
it but then can't handle it in any way.

How do I rename or delete this folder? I can find no way and am not new to
this game!

Hi Mike

This solution was posted by John John a few weeks ago and succeeded for
a poster where all else had failed :)

In Explorer navigate to the parent folder of the undeletable folder.
Leave the Explorer window open.

Open a Command Prompt and type the partial command:

RD "\\?\

From the opened Explorer window grab the bad folder and drag it to the
Command Prompt and drop it at the end of the incomplete command.
Complete it 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. Then press enter.

(If the folder name, when dropped, brings a set of quotes with it,
delete the one directly in front of "Backup " and don't add another at
the end, so that you only have one complete set around the whole
command, otherwise you will get a syntax error.)

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

Guest

DOS can't to any of this, because it's strictly Windows stuff.
However, you can still call the Command Prompt "DOS" even
though it lacks the very basic elements of DOS. It's your choice.

Thank you for acknowledging it IS my choice. I did not SAY it was DOS, I
said I still CALL it DOS because of a long history of using DOS. Why the
anger???

Now, on to other things that might be helpful.
 
G

Guest

WOW!! That's some fancy coding. Nothing in the /? info shows this syntax.
It does seem to have worked. Although the left panel in Explorer still shows
the folder, the right pane does not show it. This is yet another bug in
Explorer! I will log off and back on and see if it fixes its display.

The "command prompt" (DOS to some of us) shows it gone. I think it has been
accomplished.

What does this syntax do? I bet you are one of only a few people including
the author who knows about this miracle.

THANKS!!! I owe you a tasty beverage of your choice next time you are near
Vallejo.

Mike Morrow
 

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