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