How To Delete or Remove a Directory in DOS Command Prompt

To delete a directory in MS DOS, the command is rmdir (remove directory). For Example : rmdir (space) path of the directory and then press enter on keyboard.

EXAMPLE :::

Say, if there is a file manurian in the D drive under a directory supuser that means the path of the file is D:\supuser\mansurian.

If you put command rmdir d:\supuser on DOS command prompt and press Enter on keyboard. You will find an error. The directory supuser do not deleted. Because there is a file mansurian in that directory. 

To delete or remove  a directory be sure that the directory is empty. So first delete the file mansurian from the directory. The complete command is to delete the file and directory is

1. open DOS Command Prompt
2. type d: and press Enter on keyboard
3. type cd supuser (directory name) to enter into the directory
4. type delete mansurian (file name) and press Enter on keyboad.

Now your file mansurian is deleted.

5. type cd .. to come out from directory supuser
6. type rmdir D:\supuser

Now the directory supuser will be deleted.

How To Delete or Remove a Directory in DOS Command Prompt How To Delete or Remove a Directory in DOS Command Prompt Reviewed by Mani on May 27, 2012 Rating: 5

No comments:

Powered by Blogger.