Make your own free website on
Using The Delete
Command In DOS

Command: DEL (ERASE) [d:][path]filename [/P]

Purpose: Deletes (erases) files from a disk or hard drive.

Discussion: You can use wildcard characters (? and *) to delete groups of files. If you don't specify a pathname, the program assumes the files to be deleted are on the drive and directory you are currently using. The /P option prompts you to enter a Y or N for each file selected for deletion.


Be careful when you use this command with wildcard characters: groups of files can be erased with one command entry. For example, if you enter

del t*.*

all files in the current directory that begin with the letter T will be immediately erased.


To erase the file LETTER3.TXT from the LETTERS directory on the diskette in drive C, enter:

del C:\letters\letter3.txt

To erase all the files in the current directory, enter

del *.*

If you use this form of the command (to delete all files in a directory), the program will display the prompt

Are you sure (Y/N)?

If you are sure you are deleting the files you want to delete, press the letter Y key to start the erasing process.
Back To Computer Hardware & MS-DOS Information Main Page