How to delete locked files in Windows 10 using Command Prompt?

0

Here is how you can delete locked files on your Windows 10 PC/Laptop using Command Prompt?

While using Windows 10 operating system sometimes you might encounter a folder that you’re unable to delete. Ever thought or gave a try to solve the error? No, then here is what happens. Generally, the file is used or locked would be the main reason. It’s most likely because another program is currently trying to use the file. This can occur even if you don’t see any programs running.

When a file is open by another app or process, Windows 10 puts the file into a locked state, and you can’t delete, modify, or move it to another location. Usually, after the file is no longer in use, the application will unlock it automatically, but that’s not always the case. Sometimes, a file may not unlock successfully, and even if you try to take any action, you’ll see a warning that the operation can’t be completed because it’s open by another program.

In such cases, we need to use the Command Prompt. Command Prompt is a built-in feature of Windows 10, and it works pretty well. With the command prompt, you can delete any file or folder on the Windows 10 operating system. So now let’s take a look at how you can delete these locked files using CMD.

Delete Locked Files in Windows 10 using Command Prompt

  1. First of all, open the Windows Search box.
  2. On the Windows Search box, search for ‘CMD’ or ‘Command Prompt’
  3. Right-click on the ‘CMD’ or ‘Command Prompt’ and select the option ‘Run as administrator’
  4. Now you need to navigate to the folder where the file is stored.
  5. Find file path in Windows: Right Click > Properties > Details
  6. To navigate the folder, use the command:
    1. cd folderpath // replace folderpath with the path that was found in the details
  7. After navigating to the folder, you need to execute the delete command. Simply, execute the command given below
    1. del /f /s <filename> // Replace the <filename> with the actual name of the file
  8. Now on the Command prompt, type ‘Y’ and press the Enter button
  9. Done!!

This is how you can delete a locked file on your Windows 10 PC/Laptop using the in-build Command Prompt. For more news on tech and cybersecurity stay tuned on Android Rookies by following us on Google News.

Share.

About Author

Be Ready for the challenge

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments