How to delete an empty file or folder from CMD in Windows

It turns out that many times we want to perform a task, such as deleting a folder or file, but this action is not allowed by the system. This can be due to several reasons and one of them is that some processes use it. But there is a very simple and practical way to use for delete an empty file or folder from CMD in Windows.

<a name=How to delete an empty file or folder from CMD in Windows" src="/images/posts/42c47ce21a4b5ca17a12758826f5a843-0.jpg">


Whether as you hear, from the CMD or as the command prompt is more commonly known, through this console you can execute various commands, so that certain tasks are performed.



These can result from viewing a list of folders and files in a directory, using the dir command or to check if there is an Internet connection and for this use the command ping

Of course, there are many other commands we can use for various tasks, but these get forgotten over time. Since Windows now allows a very different way of executing its commands.

But this option will always be there to make changes to the system and for this reason it is convenient to disable the command prompt access of CMD.

How to delete an empty file or folder from CMD in Windows

Nowadays, many people have gotten used to the interface it presents Windows and they are a little scared of using the command prompt console, especially if Windows 10 won't boot.

Since they don't know very well how they work or because they don't understand the different commands they can enter. But we can tell you that work through DCM it can be a very rewarding experience.


And it will never hurt to acquire new knowledge, to help us solve problems that would otherwise be impossible. It is important to note that only one task will be performed, as long as you enter the specific command for it.



And then we'll show you which command you need to enter for delete an empty file or folder from CMD in Windows.

Steps to delete an empty file or folder from CMD in Windows

Although we have indicated in the introduction of the article, that you could use the Command Prompt, if you have had a problem deleting a folder or file.

It would also be a way to practice using other methods for that task. And not just using the traditional ways you're used to doing it.

Delete a file

For this we will go to the command prompt, where a window with a black background will appear. Here we will write the cd command.

This is to change to the directory where the file to be deleted is located. Once found, we will write this command DEL / F / A

To make you understand a little, the DEL command will allow us to delete the file on the hard drive, the / F parameter will force the deletion of the file. And the / A parameter, that's how you can delete files that are marked ready for archiving. Now we will tell you how folders are deleted.

  Delete folders

This procedure is similar to the one we do to delete a file, but instead of using the DEL (DELete) command we will use the RD (Remove Directory) command.



In the same way we will use the CD command, to locate the folder to be deleted and after having identified it we must write the following RD / S command


Il parameter / S will allow us to delete all subfolders found in the parent folder. It is possible that these commands could not be executed and show us an error message. This is due to the permissions we need to have to make changes or delete files or folders.


<a name=How to delete an empty file or folder from CMD in Windows" src="/images/posts/42c47ce21a4b5ca17a12758826f5a843-1.jpg">

So, to fix this, we need to open the console of the Command Prompt with administrator permissions and that's it. In this simple way we taught you how to delete an empty file or folder from CMD in Windows. And you will only have to apply the procedures that we explain in this tutorial.

Tagsfinestre
add a comment of How to delete an empty file or folder from CMD in Windows
Comment sent successfully! We will review it in the next few hours.