CMD force delete folder

Share the post

CMD force delete folder: All Windows know about this useful tool command prompt or CMD. Well, this tool you may not need in daily use but if you have to do something more than usual work then this tool can be useful.

At times, you may encounter this problem where you are unable to delete folders/files with the help of Windows Explorer. It can happen because a virus may be responsible for this and prevents the folders /files locking obstructing the deletion of files and folders.

When this happens you need to switch to CMD tool to remove those files/folders.

If you do not wish to use CMD to force delete folder or files in Windows due to some reason then there are a number of free tolls available that make your work easier.

These free tools help you unlock files/folders and let you delete the files/folders using Explorer. On the other hand if you wish to continue using CMD prompt to avoid installation of an external tool then CMD is always useful.

When you opt to use – command prompt, make sure you use it carefully. The reason being in case you tend to delete any of the system files by mistake you will not be able to use your computer at all.

You will then need to install your operating system again to resolve the issue. Thus make sure that you use CMD tool very cautiously.

The instructions given below will teach you how to delete folders/files with the help of CMD tool in Windows.

 

CMD force delete folder or file:

Deleting a single file

  • Expand command prompt for which type – CMD in the search box of your taskbar
  • Click – Command prompt
  • Go to the folder where the file that you wish to delete is present. You can do it by using – cd command
  • Type the command given below in your command prompt

DEL /F /Q /A name_of_the_file

/F – force delete
/Q – will not display – Y/N confirmation and just will remove the files automatically
/A – selects the files having ready for archiving attribute

Also, file path can be used directly for example just type

DEL /F /Q /A C:\Users\HP1\Documents\file.txt

If your file gets deleted, no error will be displayed.

 

Deleting a folder

Open command prompt for which in search box of the taskbar type CMD

Click on- Command Prompt

Head to the folder which contains the folder that you want to erase using the command – cd

Type the command as shown below in command prompt

RD /S /Q name_of_the_folder

RD means remove directory.

/S – deletes all subfolders & files

/Q – will not show up – Y/N confirmation and automatically delete the files

Another thing you can use is folder path for instance type

RD /S /Q C:\Users\HP1\Documents\folder1

 

Related Post: How to run cmd as administrator

When it comes to command prompt, it is certainly the most powerful tool found in Windows. When other tools do not work, command prompt always comes for the rescue.

The most important things where command prompt always works great and brings in a ray of hope for you are when your PC is infected and you just cleaned it. You keep trying for a long and find multiple files and folders remain there and you are unable to delete them.

In such cases, you just want to delete those files at any cost as it becomes the priority to delete those files to ensure that those infected files do not bring back the infection to your system.

Now you are not able to delete those infected files with the help of Windows explorer so you need to use CMD command prompt, but with caution.

Using third party tool certainly helps you delete these files for which you need to understand how that tool works. You can get free tools online and before you attempt to use them, learn the right way to use them.

Using command prompt is certainly a challenging task if you haven’t used it before deleting some system files accidentally can stop you from accessing your system completely, so make sure you follow the steps carefully and seek help from someone who has technical knowledge of using CMD before. This will help you to learn how to use it to delete files and folders easily when you are using it for the first time.

Follow Us On:
  •  
  •  
  •  
  •  

Leave a Reply

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