So you can delete any file from CMD in Windows


Although the conventional use of Windows is currently the graphical interface, through which most of the actions can be carried out thanks to its high compatibility, the truth is that on specific occasions users prefer to use the Windows command console, Also known as Command Prompt, CMD, or command prompt.

In this case, it is a console inherited from the MS-DOS operating system, in which the commands cannot be compared with those of operating systems such as those based on the Linux architecture. That is why, sometimes, you may not be clear about how to perform a certain action using the CMD console, so we are going to show you in this article how you can easily delete any file using Windows' own command console.

How to delete files using the CMD console in Windows

As we mentioned, although in most cases file deletion can be easily achieved using the operating system's own file explorer, if you wish. you will be able to eliminate without any problem any type of file that bothers you, being able to force even it.

To do this, you must first go to the directory in question using the command cd ruta-archivo. Once you are in the directory of it, something that you can easily see since the command bar shows it just before the cursor, you must execute the following command to delete the file you want:

DEL /F /A <archivo.extension>

Delete files from CMD in Windows

Windows PowerShell
Related article:
How to delete folders or directories from the CMD console in Windows

In this case, unlike for delete a directory or folder, the concrete instructions of the command come from the operation DELETE (DEL, in English delete), on which the attribute is executed /F to force delete the file in question, in addition to /A, which allows you to delete only files marked as ready for archiving by the operating system itself.

Be the first to comment

Leave a Comment

Your email address will not be published. Required fields are marked with *



  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.