Windows prevent certain files from being deleted or moved. This can be really frustrating when you want to remove a file that you don’t need but are unable to do so. If you’re in this predicament, try the methods below.
- Close associated process
- Force delete files/folders using command prompt
- Delete files/folder in Safe Mode
Method 1: Close associated process
If the file you’re trying to delete is in use by a program or process, you’ll not be able to delete it. Usually, you’ll get a message saying the file is locked. If that’s the case for you, follow the instructions below:
- Right-click the Taskbar and select Task Manager.
- Right-click the process or program that you know is using the file, then select End Task/Process.
- Try deleting the file again.
If you still can’t remove the file, then check the next method below.
Method 2: Force delete files/folders using Command Prompt
Another way to force delete files or folders on your computer is by using Command Prompt. Follow the instructions below:
- Right-click the file you want to delete, then select Properties and check the file’s location.
- On your keyboard, press the Windows logo key and R at the same time.
- Type cmd, then press Ctrl, Shift and Enter keys on your keyboard to run Command Prompt as administrator.
- Enter del and location of the file you want to force delete (e.g. del c:\users\pc\desktop).
- Press the Enter key on your keyboard to execute the command.
If this didn’t work for you, then move on and try the next method, below.
Method 3: Delete files/folders in safe mode
If you can’t delete the file in normal mode, then try doing this in Safe Mode.
- Boot your PC into safe mode.
If you’re on Windows 7, check this to see how to boot your Windows 7 computer into safe mode. If you’re on Windows 10 or 8, please check this to see how to enter safe mode on Windows 8 or 10 devices.
- Delete the file/folder once you boot your computer into safe mode.
- To exit Safe Mode, simply restart your computer.
Hopefully, this post helped. If you have any questions or suggestions, please feel free to leave a comment below.