Can't Delete Files, Folders or Icons in Windows 10? Fix It
In this article
If Windows 10 refuses to delete a file, folder or desktop icon, the cause is almost always one of three things: the item is in use by another process, your user account lacks permission, or the file is stuck in a corrupted state. The quickest first move is to restart the PC and try again, because a restart releases file locks held by background apps and Explorer itself. If the item still won't go, work through the steps below in order — they go from safest and simplest to more aggressive, and each one tells you what it does before you run it.
What You'll Need
- A Windows 10 PC with an account that has administrator rights (needed for several steps).
- File Explorer open to the item you want to remove.
- Command Prompt or PowerShell — both are built in, nothing to install.
- Patience: some fixes only take effect after a sign-out or restart.
Step-by-Step
- Restart the computer. A full restart (Start > Power > Restart) clears file locks held by Explorer and background apps. Do not use Shut down and then power on — Fast Startup can preserve the lock. After the restart, try deleting the item again.
- Close anything that might be using the file. Open Task Manager with Ctrl+Shift+Esc, look through the Processes list for the app that likely has the file open (a document editor, media player, sync client, antivirus scan), select it and click End task. Then retry the delete.
- Check the file isn't read-only. Right-click the file > Properties, and clear the Read-only checkbox if it is ticked. Click Apply, then OK, and try deleting again.
- Take ownership and grant yourself full control. Right-click the file or folder > Properties > Security tab > Advanced. Next to Owner, click Change, type your Windows username, click Check Names, then OK. Tick “Replace owner on subcontainers and objects” if it's a folder, click Apply. Back on the Security tab, click Edit, select your username, tick Full control under Allow, and click OK. Try the delete again.
- Delete from Command Prompt. Open Start, type cmd, right-click Command Prompt and choose Run as administrator. For a file, type
del "full\path\to\file"and press Enter. For an empty folder, userd "full\path\to\folder". To remove a folder and everything inside it, userd /s /q "full\path\to\folder"— this deletes the contents permanently, so double-check the path first. You can copy a path quickly by holding Shift, right-clicking the item and choosing Copy as path. - Run a disk check. In the same administrator Command Prompt, type
chkdsk C: /fand press Enter. If it says the volume is in use, type Y to schedule it for the next restart, then restart the PC. This repairs file-system errors that can make an item undeletable. - Boot into Safe Mode and delete there. Open Settings > Update & Security > Recovery, and under Advanced startup click Restart now. Choose Troubleshoot > Advanced options > Startup Settings > Restart, then press 4 for Safe Mode. In Safe Mode only essential drivers load, so third-party locks are gone. Delete the item, then restart normally.
- For desktop icons that won't go: right-click the desktop, choose Refresh, then try deleting again. If it's a shortcut that keeps coming back, check whether it lives in the Public desktop folder (C:\Users\Public\Desktop) as well as your own — delete it from both. If the icon is a built-in one such as This PC or Recycle Bin, remove it through Settings > Personalization > Themes > Desktop icon settings instead of deleting it.
- Run a malware scan. Open Windows Security > Virus & threat protection > Scan options, choose Full scan and run it. Some unwanted software recreates files after deletion, which looks like a delete that “doesn't work”.
Menu labels in Windows 10 can differ slightly depending on your build, language and whether you're on a local or Microsoft account, so if a label isn't exactly as written, look for the closest match.
Common Mistakes
- Using Shut down instead of Restart. With Fast Startup enabled, shutdown is closer to hibernation and does not release every lock. Restart does.
- Running
rd /s /qon the wrong folder. There is no Recycle Bin recovery for this. Always paste the path from Copy as path rather than typing it by hand. - Changing ownership of a whole drive. Take ownership of the specific file or folder only. Changing permissions at the root of C: can break Windows updates and built-in apps.
- Deleting from the Public desktop only. A shortcut that reappears usually exists in both your user desktop and the Public desktop; remove it from both.
- Assuming a locked file is a virus. Most locks come from ordinary apps — sync clients, backup tools and antivirus real-time scanning are common culprits.
Tips
- Hold Shift while pressing Delete to skip the Recycle Bin when you know you want the item gone permanently.
- If a file is locked and you can't find the app, sign out of Windows and back in — it's faster than hunting through Task Manager.
- Keep the path short. Deeply nested folders with very long names can hit path-length limits and fail to delete; move the item closer to the drive root first, then delete.
- For stubborn icons, rebuild the icon cache by deleting IconCache.db from your local AppData folder while Explorer is closed — Windows recreates it on the next sign-in.
- Before any aggressive step, copy the file somewhere safe if you might need it later. Ownership and permission changes are reversible; a forced delete is not.
Troubleshooting
“You need permission to perform this action” keeps appearing. Repeat the ownership step but make sure you clicked Check Names and that the name resolved to your account before clicking OK. If the folder is on a network drive or a removable disk, the permissions may be controlled elsewhere — try deleting from the machine that owns the share.
The file vanishes but reappears after a restart. Something is recreating it. Check startup apps in Task Manager > Startup, and run a full malware scan. Sync clients are a frequent cause: pause the sync, delete the file, then resume.
Command Prompt says “Access is denied”. Confirm you opened it with Run as administrator. If it still fails, boot into Safe Mode and run the same command there.
The item is on the desktop but nothing happens when you press Delete. Click an empty spot on the desktop first so the desktop has focus, then select the icon and press Delete. If it's a pinned or system icon, use Desktop icon settings as described in step 8.
chkdsk reports errors it cannot fix. Back up important data from the drive first, then run the manufacturer's drive diagnostic tool. Persistent file-system errors can indicate failing hardware, and no amount of permission changes will fix that.
Frequently Asked Questions
Why can't I delete a folder even as an administrator?
Administrator rights don't automatically grant ownership of every file. You usually need to take ownership and add Full control on the Security tab before deletion succeeds.
Is it safe to use rd /s /q?
It permanently deletes the folder and everything inside without confirmation. It's safe only when the path is exactly right — paste it with Copy as path rather than typing it.
How do I remove built-in desktop icons like This PC?
Right-click the desktop > Personalization > Themes > Desktop icon settings, untick the icons you don't want, and click OK. They aren't files, so deleting them directly doesn't work.
Will Safe Mode let me delete a locked file?
Often yes, because third-party programs and drivers don't load in Safe Mode. If the file is locked by a Windows component, it may still resist — in that case use the Command Prompt method from Safe Mode.
Does taking ownership break anything?
Not when applied to a single file or folder. Applying it to an entire drive or to system folders can cause permission problems for Windows itself, so keep it targeted.
What if the file is on a USB drive or SD card?
The same steps apply, but check the write-protect switch on SD cards and adapters first. If the card is read-only at the hardware level, no software setting will override it.