Help - How to delete and entire directory from within DOS?

G

Guest

I needed to go to DOS b/c my system locked me out. I am trying to run DELTREE or RMDIR on some directories so they can be erased, but I can't get these commands to work

From the DOS prompt, when I run ... RMDIR [directory name] ... I get the following error: "Invalid Path, Not Directory, or Directory not empty." The reason it fails is that the directory in NOT EMPTY. So I read that I needed to run this command to make it work: ... RMDIR [directory name] /S ... but when I do that, I get this error: "Invalid Switch - /S

My question is, how do I remove an entire directory (including the files) from a DOS prompt

Thanks
 
P

Patti MacLeod

Hi Brett,

You mentioned using the DELTREE command (which is what you'd have to use in
order to remove a directory that isn't empty), but you didn't detail why it
doesn't work. Are you ensuring that, when you run the DELTREE command, that
you are one directory above the one that you want to delete? For example, if
the directory that you want to delete is the "My Downloads" directory that
is located at C:\My Files\My Downloads then you would have to change to the
C:\My Files directory in order to DELTREE the My Downloads directory beneath
it.


Regards,
--
Patti MacLeod
Microsoft MVP - Windows Shell/User

Brett said:
I needed to go to DOS b/c my system locked me out. I am trying to run
DELTREE or RMDIR on some directories so they can be erased, but I can't get
these commands to work.
From the DOS prompt, when I run ... RMDIR [directory name] ... I get the
following error: "Invalid Path, Not Directory, or Directory not empty." The
reason it fails is that the directory in NOT EMPTY. So I read that I needed
to run this command to make it work: ... RMDIR [directory name] /S ... but
when I do that, I get this error: "Invalid Switch - /S"
 
R

roger

Hi Brett,

You can also use the command 'rd' while on the parent directory, as
Patti pointed out.

Look at this example:

Microsoft Windows XP [Versión 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.


C:\>rd C:\Farmer1
El directorio no está vacío.

C:\>rd Farmer1 /s
Farmer1, ¿Está seguro (S/N)? s

C:\>


Good luck, hope this helps
 

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