CMD

How to delete files and folders using Command Prompt in Windows 10

How to delete files and folders using Command Prompt in Windows 10

At times, all our attempts to delete files or folders via File Explorer yield no results. Many reasons can be attributed to the failure, which can lock down the files/folders and prevent their deletion. In such cases, you can use the Command Prompt to delete files, folders, and subfolders.

Delete files & folders using Command Prompt

First things first, using the Command Prompt incorrectly may render your system inoperable, and at the time you will not be able to recover deleted files. So proceed carefully and exercise extreme caution.

There are multiple ways via which you can delete a file or a folder on your Windows system. It is possible that you'll run into problems if the file is locked. This is where the Command line prompt finds its real utility.

To delete files using Command Prompt, make sure to open it with admin privileges.

1] Delete the desired file

When the CMD window opens, navigate to the folder where the file is available. You will have to use the “cd” or change directory command. Then, use the following command with options in the prompt:

DEL /F /A 

Here:

2] Delete the desired folder

Navigate to the folder containing the folder you wish to delete by using the 'cd' command. Type the following command in the Command Prompt:

RD /S 

Here:

If you use the /Q parameter also, then you will not be asked for the Y/N confirmation.

If the folder or file is locked, you can follow these instructions to delete locked or undeletable files & folders.

Try this and let us know in the comments section below if the method works for you.

You can also delete files and folders using Windows PowerShell. This post will show you how to add Delete Folder Contents to Context Menu.

Gry Jak zwiększyć FPS w Linuksie??
Jak zwiększyć FPS w Linuksie??
FPS oznacza Klatki na sekundę. Zadaniem FPS jest pomiar liczby klatek na sekundę podczas odtwarzania wideo lub wydajności gier. W prostych słowach lic...
Gry Najlepsze gry w laboratorium aplikacji Oculus
Najlepsze gry w laboratorium aplikacji Oculus
Jeśli jesteś posiadaczem gogli Oculus, musisz wiedzieć o sideloadingu. Sideloading to proces instalowania w zestawie nagłownym treści innych niż sklep...
Gry Top 10 Games to Play on Ubuntu
Top 10 Games to Play on Ubuntu
Windows platform has been one of the dominating platforms for gaming because of the huge percentage of games that are developing today to natively sup...