DOS- REMOVING DIRECTORIES

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to remove a directory but there's more than one word in the
directory name. I have a version of dos which shows the full name of the
directory and/or file unlike older versions which showed only a small amount
of the file name and a ~ at the end.

How do I enter in the RMDIR command when I have a directory with more than
one word? I've tried entering a . in between and I've tried keeping a space
in between but nothing works and all I get is an error message saying it
can't find the file specified.

Thx.
 
To use long file/folder name, use " " at the being/end of the file/folder
name:

rmdir "c:\Bad Folder to Remove"
 
If you are using MS-DOS 7.0 (command.com or command.exe - don't
remember) or CMD.exe from an NT OS, put quotes around the whole directory as
in:

rmdir "C:\Documents and Settings"

If you are using a older version or just want the short
directory/filename do a:
dir /x to provide you a list of 8.3 filenames with the long filenames,

C:\>dir /x
12/29/2004 18:08 <DIR> DOCUME~1 Documents and Settings
12/29/2004 21:11 <DIR> MYINST~1 My Installations
02/03/2005 22:33 <DIR> PROGRA~1 Program Files
12/30/2004 21:28 <DIR> VFPTOO~1 VFPToolkitNET

then use:

rmdir C:\DOCUME~1



--
Star Fleet Admiral Q @ your service!
"Google is your Friend!"
www.google.com

***********************************************
 
Alternately you can also use the full name truncated to eight characters
with the ~1 at the end, as in:

rd c:\docume~1

--LB
 
Whenever you're dealing with long file or folder names from the Command
Line, you need to enclose them in quotes.

such as

cd "program files"
or rd "some folder"
or copy "long file name.txt" "another long filename.txt"
 
That's the 8.3 name. You have to know what the real 8.3 name is. You can't
just make it up yourself.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
Lily said:
I'm trying to remove a directory but there's more than one word in the
directory name. I have a version of dos which shows the full name of the
directory and/or file unlike older versions which showed only a small amount
of the file name and a ~ at the end.

Wrap it in quotes - eg "C:\program Files\Unwanted folder"
 
It's always truncated to eight characters.

Wesley Vogel said:
That's the 8.3 name. You have to know what the real 8.3 name is. You can't
just make it up yourself.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 

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

Back
Top