How to Delete a File or Folder using CMD?

Configurare noua (How To)

Situatie

In some cases, for whatever reason, Windows will make sure that the provided file is used by the system and prevent it from being deleted. This file situation is very frustrating, especially if you know the file is not in use.

If you are having trouble in deleting any file or folder directly by right-clicking, then you can delete it using cmd. The commands below delete the specific file or folder and place them in the recycle bin:

  • del
  • rmdir

Solutie

Pasi de urmat

Here we have created a sample File and a Folder to delete it using CMD:

del command is used to delete a file. Here, we will take our sample file “hello.txt” located at the desktop and try to delete it using the del command in CMD. Follow the steps given below to delete the file:

Step 1: Change the path of the directory in CMD and set it to the path of the file. Type the following command in cmd and press Enter:

cd desktop

Step 2: Delete the file “hello.txt” with following command:

 del hello.txt

rmdir command is used to delete the entire folder or directory. Here, we will take our sample folder named “Tasks” placed at desktop and try to delete it using rmdir command in CMD. Follow the steps given below to delete the folder:

Step 1: Change the path of the directory in CMD and set it to the path of the folder. Type the following command in cmd and press Enter:

cd desktop

Step 2: Delete the folder “Tasks” with following command:

rmdir tasks

Tip solutie

Permanent

Voteaza

(2 din 3 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?