How to Delete Locked Files in Windows via CMD

Sometimes, when deleting a file in Windows, we encounter an annoying dialog box indicating that the file is locked or that we are not allowed to perform the action. In such cases, we need to use the Command Prompt. With the command prompt, you can delete any file or folder on Windows. 1. First of […] The post How to Delete Locked Files in Windows via CMD appeared first on TechViral.

How to Delete Locked Files in Windows via CMD
Why the Hen Does Not Have Teeth Story Book

WHY THE HEN DOES NOT HAVE TEETH STORY BOOK

It’s an amazing story, composed out of imagination and rich with lessons. You’ll learn how to be morally upright, avoid immoral things, and understand how words can make or destroy peace and harmony.

Click the image to get your copy!

Why the Hen Does Not Have Teeth Story Book

WHY THE HEN DOES NOT HAVE TEETH STORY BOOK

It’s an amazing story, composed out of imagination and rich with lessons. You’ll learn how to be morally upright, avoid immoral things, and understand how words can make or destroy peace and harmony.

Click the image to get your copy!

Why the Hen Does Not Have Teeth Story Book

WHY THE HEN DOES NOT HAVE TEETH STORY BOOK

It’s an amazing story, composed out of imagination and rich with lessons. You’ll learn how to be morally upright, avoid immoral things, and understand how words can make or destroy peace and harmony.

Click the image to get your copy!

Sometimes, when deleting a file in Windows, we encounter an annoying dialog box indicating that the file is locked or that we are not allowed to perform the action. In such cases, we need to use the Command Prompt. With the command prompt, you can delete any file or folder on Windows.

1. First of all, open the Windows Search box.

open the Windows Search box

2. In the Windows Search box, search for CMD.

search for 'CMD'

3. Right-click on the CMD and select the option Run as administrator.

select the option 'Run as administrator'

4. Navigate to the folder where the file is stored.

Find file path in Windows: Right Click > Properties > Details

find file path details

To navigate the folder, use the command:

cd folderpath

Execute the command

Note: Replace ‘folderpath’ with the actual path where the file is stored. For example, cd C:\Users\techviral\desktop

5. After navigating to the folder, you need to execute the delete command. Execute the command given below.

del /f /s 

Execute the command

Note: Replace the with the file’s actual name. Also, include the file extension. For example, del /f /s notepad.txt

6. Now, on the Command prompt, type Y and press the Enter button.

Deleted file

This article explains how to delete locked files in Windows via the command prompt. I hope it helped you. Please share it with your friends. If you have any questions, let us know in the comment box below.

The post How to Delete Locked Files in Windows via CMD appeared first on TechViral.

What's Your Reaction?

like

dislike

love

funny

angry

sad

wow