Can't Delete a File on Desktop? Fix It Now
In this article
You cannot delete a file on your desktop because it is in use by another program, you lack permission, the file is read-only or system-protected, or Windows Explorer is glitching. The quickest fix is to close any program that might be using the file, then try again; if that fails, restart your PC and retry. If the file still won't go, take ownership or use Safe Mode. This guide walks through each cause and the exact steps to remove the file safely.
What You'll Need
- Administrator rights on the PC (for permission-related fixes).
- A restart is often enough, so save your work first.
- Command Prompt or PowerShell access (built into Windows).
Step-by-Step
- Close programs that may be using the file. Open Task Manager with Ctrl+Shift+Esc, look for apps like Word, Excel, PDF readers, or photo editors, and end any that might have the file open. Then try deleting again.
- Restart your PC. A restart releases file locks held by background processes. After signing back in, try deleting the file before opening anything else.
- Check if the file is read-only. Right-click the file, choose Properties, and clear the Read-only checkbox under Attributes. Click Apply, then OK, and try deleting.
- Take ownership (if you get an access-denied message). Right-click the file, choose Properties > Security > Advanced. Next to Owner, click Change, type your username, click Check Names, then OK. Tick Replace owner on subcontainers and objects, click Apply, then OK. Back in the Security tab, click Edit, select your user, tick Full control, and click OK. Try deleting again.
- Delete from Safe Mode. Open Settings > Update & Security > Recovery (or Settings > System > Recovery on newer builds) and choose Restart now under Advanced startup. After the restart, select Troubleshoot > Advanced options > Startup Settings > Restart, then press 4 for Safe Mode. In Safe Mode, navigate to your desktop and delete the file. Restart normally afterward.
- Use Command Prompt as a last resort. Open Start, type cmd, right-click Command Prompt, and choose Run as administrator. Type
del "C:\Users\YourName\Desktop\filename.ext"(replace with the actual path and filename) and press Enter. If the file is a folder, usermdir /s /q "path". Close the window and check the desktop.
Menu labels can differ slightly by Windows version, device, or region. The steps above apply to Windows 10 and 11; on Windows 11, some Security dialogs look different but follow the same path.
Common Mistakes
- Deleting the shortcut instead of the file. If the file is a shortcut, deleting it removes only the link, not the original. Right-click and check Properties to see the target.
- Ignoring the "file in use" message. That message names the program holding the file. Close that program first rather than forcing a delete.
- Skipping the Recycle Bin check. Sometimes the file is deleted but the desktop icon remains until you refresh (F5). Press F5 or right-click the desktop and choose Refresh.
- Using third-party "unlocker" tools from unknown sources. Only use official Microsoft tools or built-in Windows features; unofficial download sites can bundle malware.
- Forcing deletion of system files. Files like desktop.ini are protected. Do not delete them; they are hidden system files that manage folder settings.
Tips
- Before deleting, make sure the file is not open in a background app like OneDrive or a cloud sync client. Pause syncing temporarily.
- If the file is on a network drive or synced folder, delete it from the syncing app's interface instead of File Explorer.
- Use Shift+Delete to bypass the Recycle Bin only when you are certain you will not need the file again.
- Keep Windows updated; file-locking bugs are sometimes fixed in cumulative updates.
- If you use a third-party antivirus, it may lock files during a scan. Wait for the scan to finish or add an exclusion.
Troubleshooting
If the file still will not delete, work through these checks in order:
- Check for a stuck Explorer process. Open Task Manager, find Windows Explorer, right-click, and choose Restart. The desktop will refresh; try deleting again.
- Run a malware scan. Use Windows Security (Start > Settings > Privacy & security > Windows Security > Virus & threat protection) and run a full scan. Some malware locks files.
- Boot into Safe Mode with networking and try the delete there. If it works, a startup program was holding the file. Disable startup items in Task Manager > Startup tab.
- Use the built-in Disk Cleanup or Storage Sense only for temporary files; do not use them on personal files.
- If the file is on a USB drive or external disk, eject and reconnect the drive, then try again. If the drive is write-protected, check the physical lock switch on SD cards.
- Create a new user account and try deleting from that account. If it works, your original profile may have corrupted permissions; move your files and create a fresh profile.
Warning: Do not use registry cleaners or "force delete" tools that claim to remove locked files unless they come from Microsoft or a trusted vendor. Back up important files before making permission changes.
Frequently Asked Questions
Why does Windows say the file is open in another program?
Another process has a handle on the file. Close the named program, or restart the PC to release the lock.
Can I delete a file that is read-only?
Yes. Clear the Read-only attribute in the file's Properties, then delete it.
What if I don't have permission to delete the file?
You need to take ownership and grant yourself Full control in the file's Security settings, as described in Step 4.
Is it safe to delete desktop.ini?
No. Desktop.ini is a system file that stores folder customizations. Deleting it can cause display issues. Leave it alone.
Why does the file reappear after I delete it?
A sync service like OneDrive may be restoring it. Pause syncing, delete the file, then resume syncing.
Can I delete a file from the command line if Explorer won't?
Yes, using Command Prompt as administrator with the del command often works when Explorer fails.