If a file or folder is in use, i.e. it’s open in an app, or a process on your system is using it, you cannot delete it. This becomes evident when you see the file or folder in use error box that prevents the deletion process from completing. Here’s what you can do to delete a file or folder in use.
Normally, a file or folder in use error is harmless. All you really have to do is make sure the file or folder you’re trying to delete isn’t being used by an app. In the case of a folder, if there’s a file within the folder is in use or open, it will prevent the folder from being deleted. Make sure everything is closed properly.
Sometimes Windows 10 thinks an app is still using a file when it is in fact done with it. For example, if you upload a file from Chrome to any website/web service, Windows 10 sometimes thinks the file is still open in Chrome even though the upload has finished. The same can happen with other apps so the safe thing to do is to close any apps that you might have used to access the file (or folder) in question.
If all that fails, there’s a simple way to get around it; safe mode.
Delete file or folder in use
Restart Windows 10 in Safe Mode. There are a few different ways to do this, however the easiest way is to open the Start Menu, click the power options, hold down the Shift key and click on Restart from the power options menu.
You will boot to a blue screen with various options. Select Troubleshoot>Advanced Options>start up settings and click on Restart. On the next screen, you will see a numbered list of actions. Enter the number that corresponds to Safe Mode. For me, it was 4 but you should go through the list you see and make sure you pick the right option.
Once you’re in safe mode, go ahead and delete the file or folder. This is also a good way to get rid of smaller, less malicious viruses however you should use Shift+Delete instead of regular delete if you suspect the folder or file is malicious.
To return to your normal Windows 10 desktop, simply restart your system.
If the file or folder comes back after being deleted, it means it is being created again by an app or process on the system. You might very likely need to scan your system for malicious apps in this case.