Delete Files Using MS-DOS Command Prompt

Using Microsoft Disk Operating system or MS-DOS, the internal command erases files from a disk. You can erase a single file or even a group of files in a directory or folder of a storage, like the USB flash drive.

The file- name is the name of the files to be erased. You can use wild card characters in your command, like star dot star or asterisk dot, asterisk (*. *) to erase a group of files. Erase is another name for delete.

If you use the /p parameter of your command, the command line will ask you first or confirm before to go on deleting a file. And if you include the INV*. * in your command it will erase all files that begin with "INV" in your disk.

MS-DOS
Erase Multiple Files In A Drive Using Command Prompt


HOW TO DELETE MULTIPLE FILES INSIDE THE DIRECTORY
  1. Open your computer, once you in desktop, click start menu then click in search bar and type cmd, then enter key. Or find the program called "command prompt".
  2. Once you're in command line, open the drive, example USB flash drive, like c:\USers\Home>e: then enter key
  3. If your command line like this, e:\> find the folder with multiple files you want to erase using this command, ex. e:\>cd test, then enter key. Because in my image above the files is the main directory of test. The entire is like this: e:\test\yahoo>DEL *.* , using this command all the files inside the yahoo folder will be deleted. See the image above.

MS-DOS
Erase Single Files In A Drive Using Command Prompt

HOW TO DELETE SINGLE FILES IN A DIRECTORY OF A DRIVE

  1. In your command line, change drive to a drive where you want to erase a files, example drive e:
  2. In my example, the file is inside of the directory of test, so I open the directory of test using the cd command.
  3. Once your command line like this: e:\TEST> type the command DIR then enter to display the files inside of the directory. 
  4. Once it will display, type the command like this: DEL test.bmp /p, in my example, my filename is test.bmp, then I'm using /p parameter in my command to confirm first before to erase the files. 

HOW TO ERASE FILES CALLED .INV IN YOUR DRIVE
 INV file is a file extension came from the files commonly use in a games. This is a data files not a document files in your office applications.

  1. In your command line type this command: ex. c:\USer\Home>DEL E:INV*.*

HOW TO REMOVE DIRECTORY IN YOUR DRIVE
Open first the drive where the directory of files is stored. Use the command we mention before in my last post. See the first image above of this post.

  1. To remove a directory follow this commands: c:\Users\Home>e: then enter key
  2. When your command line like this: e:\> type the command cd then folder name example cd TEST, this is use if a directory is inside of a directory like c:\Users\Home\Test\practice\, to erase this directory you need this command: c:\Users\Home\Test\practice>cd.. then enter key. I use cd.. to move the command line in a directory of test. So that I can remove the directory called practice. The command is like this: c:\Users\Home\test>rd practice the enter key
  3. Then to confirm directory deletion, type DIR command to display.

TIPS:


Take note this command is a dangerous for your computer. This possible to erase important files in your computer. So you must be careful and check before to erase a file.

OTHER REFERENCES:


  1. How to copy files using xcopy: http://www.combinebasic.com/2017/03/use-xcopy-command-in-copying-folder.html
  2. Important MS-DOS Command Use For Computer Networks And Internet: http://www.combinebasic.com/2017/03/important-ms-dos-command-use-for.html

Delete Files Using MS-DOS Command Prompt Arnel Cartoneros 5 of 5
Using Microsoft Disk Operating system or MS-DOS , the internal command erases files from a disk. You can erase a single file or even a gr...
Share on Google Plus

About Arnel Cartoneros

Arnel is a Blog creator and writer, A founder and publisher of www.combinebasic.com and www.nuggetro.info. Part time Computer Instructor, Computer And Electronic Technician, And performing job as Biomedical Machine Specialist. I'm an avid fan of social media and very interested in Technical information and innovation.