How to delete files and folders from CMD in Windows 10

Windows Articles

eDEX-UI: A cross-platform terminal with a cool graphic interface.

No doubt there are many terminal emulators on the market. However, you can hardly get one as original as eDEX-UI. In fact,...

Join our Telegram Channel

This post, it's to announce a great news. Osradar wants to reach as many people as possible because we are passionate about the same...

How to install Sublime Text 3 on Ubuntu 20.04 / Linux Mint 20?

Developing applications requires tools that can facilitate the process. In the web environment, Sublime Text is quite popular for being a very...

How to import or export Local Security Policy in Windows 10/Server 2019

Hello! Microsoft has increased the security of Windows systems with different measures. Indeed, these actions are focused on protecting data and services....

How to install Slack on Ubuntu 20.04?

Hi, folks. In this post you will learn how to install Slack on Ubuntu 20.04. Slack is an application...
Mel Khamlichi
Mel Khamlichihttp://www.osradar.com
Founder of Osradar, from Amsterdam Netherlands

Hi, how are you? Windows was born with the purpose of providing users with a graphical interface when using the computer. In fact, in the old DOS or MS-DOS systems everything was controlled by commands. However, Windows came with an intuitive graphical interface that took advantage of the use of a new peripheral known as the mouse. Currently, all users use Windows with a mouse and navigate through files and folders using the file explorer. On the other hand, it is still possible to do it classically with the CMD. Consequently, we will see how to delete files and folders from CMD in Windows 10.

Use CMD to delete folders and files

The idea of a terminal is traditionally associated with Linux operating systems. However, Windows also has its own terminal inherited from MS-DOS. This is known as Command Prompt. You will probably have used the PING command to check internet connectivity or cd to go to the hard drive directories. However, we will see how to delete folders and files using the CMD. Although it is more comfortable to use the graphical interface, it is always convenient to have this method. Because, sometimes the search button is broken. With this in mind we will use the DEL command. Next, please use the CD command to enter the directory. The syntax is as follows:

 DEL /F /A file.extension

Please remember to replace the file name with its respective extension. To enter the cmd, just press the Win+Q combination and type CMD.

Run a CMD
Run a CMD
Delete a file with the DEL command
Delete a file with the DEL command

The /F switch allows you to force the file to be deleted. While the /A allows to delete only the files marked as ready for archiving by Windows.

How to delete folders with CMD

To delete folders, the process is similar to that of deleting files. However, the change is to use the RD command. Similarly, use the CD command to enter the directory where the folder to be deleted is located. To delete folders, the process is similar to that of deleting files. However, the change is to use the RD command. Similarly, use the CD command to enter the directory where the folder to be deleted is located. The syntax is as follows:

 RD /S folder

Please remember to replace folder with the name of the folder to be deleted.

Delete a folder using the RD command.
Delete a folder using the RD command.

The /S parameter indicates that we will also delete all subfolders within the folder. If it is not used and there is a folder inside, it will not delete the main folder.

What to do if there is an error message that prevents you from deleting the folder

It is likely that when you use the DEl or RD command, the system will throw an error message that prevents you from doing the task. This usually happens because of a permission problem. Specifically, when you try to delete a folder you don’t own. Or when trying to delete a system folder. In those cases, CMD will not allow you to delete the folder or file. To solve this problem, just open CMD with administrator privileges:

Runs a CMD with administrator privileges
Runs a CMD with administrator privileges

In this way, it is possible to delete any type of folder or file. The exception is if you try to delete a protected system file.

Conclusion

In the final analysis, we saw how to delete files and folders from the CMD in Windows 10. If you like to manage your computer with the terminal, then this is your option. Before saying goodbye, I invite you to our post about an alternative dock for Windows 10. Bye!

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

eDEX-UI: A cross-platform terminal with a cool graphic interface.

No doubt there are many terminal emulators on the market. However, you can hardly get one as original as eDEX-UI. In fact,...

Join our Telegram Channel

This post, it's to announce a great news. Osradar wants to reach as many people as possible because we are passionate about the same...

How to install Sublime Text 3 on Ubuntu 20.04 / Linux Mint 20?

Developing applications requires tools that can facilitate the process. In the web environment, Sublime Text is quite popular for being a very...

How to import or export Local Security Policy in Windows 10/Server 2019

Hello! Microsoft has increased the security of Windows systems with different measures. Indeed, these actions are focused on protecting data and services....

How to install Slack on Ubuntu 20.04?

Hi, folks. In this post you will learn how to install Slack on Ubuntu 20.04. Slack is an application...
x