To force delete a file in Windows 10, first close any app that has it open. Then open Command Prompt, type del /f "C:\path\to\file.txt" using the file’s full path, and press Enter. The /f option deletes read-only files too. Files deleted this way skip the Recycle Bin.
Applies to: Windows 10. Windows 10 reached end of support on October 14, 2025, and only PCs enrolled in Extended Security Updates still get security fixes, through October 12, 2027.
Why a file won’t delete
- It’s open in an app. Windows says The action can’t be completed because the file is open in another program.
- It’s read-only, or you don’t have permission to change it.
- The path is too long, or the name has characters Windows doesn’t expect.
Be careful with files in C:\Windows or Program Files. Deleting them can stop Windows or apps from working.
Close the app that’s using it
- Close the app you used the file in. If you don’t know which one, restart your PC and try again.
- Or find it: press Windows key + R, type
resmon, and press Enter to open Resource Monitor. - On the CPU tab, type the file name in the Associated Handles search box.
- Right-click the app in the results and select End Process, then delete the file.

Only end apps you know. Save your work in them first. Task Manager is another way to close apps; opening Task Manager in Windows 10 shows how.
Delete it with Command Prompt
- In File Explorer, hold Shift, right-click the file, and select Copy as path.
- Open Command Prompt. For files in protected folders, run it as an administrator.
- Type
del /fand paste the path, then press Enter.

To delete a folder and everything in it, use rd /s /q "C:\path\to\folder". It doesn’t ask first, so check the path carefully.
Take ownership of a stubborn file
If Windows says you need permission, take ownership in an administrator Command Prompt. Use this only for your own files, not files in C:\Windows.
- Type
takeown /f "C:\path\to\file.txt"and press Enter. - Type
icacls "C:\path\to\file.txt" /grant administrators:Fand press Enter. - Delete the file with
del /fas shown above.
Delete it with PowerShell
In PowerShell, Remove-Item -Path "C:\path\to\file.txt" -Force deletes a file, including hidden and read-only ones. Add -Recurse to delete a folder and everything in it. Like del, it skips the Recycle Bin.
If it still won’t delete
- Start in Safe Mode and try again, because fewer apps are running. The steps are in starting Windows 10 in Safe Mode.
- Check permissions: right-click the file, select Properties > Security, and make sure your account has Full control. If it doesn’t, follow changing file and folder permissions in Windows 10.
- Long paths: move the folder closer to the top of the drive, like C:\Temp, or rename folders to shorter names, then delete it. Windows 10 version 1607 and later also has a registry setting for this, explained in enabling long paths in Windows 11.
- File Explorer’s preview pane is holding it: press Alt + P to close the preview pane, then try again.
- The file comes back: it may be syncing from OneDrive or being recreated by an app. Pause OneDrive or close the app, then delete it.
- Strange names or very long paths: add
\\?\before the full path, likedel "\\?\C:\path\to\file.txt". This tells Windows to skip its usual name checks.
Frequently asked questions
Can I get a force-deleted file back?
It doesn’t go to the Recycle Bin. You may be able to restore it from a backup, as explained in recovering permanently deleted files in Windows 10.
Is it safe to force delete files?
Yes, for your own files. Check the path twice, since there’s no undo. Don’t force delete files in Windows or Program Files folders; uninstall the app instead.
Why does Windows say the file is open when nothing is running?
A background task may be using it, such as a virus scan, a backup, or File Explorer making a thumbnail. Wait a minute, or restart the PC, and then delete it.
Where do normally deleted files go?
To the Recycle Bin. Finding it is covered in accessing the Recycle Bin in Windows 10.
Command details are on the del page, and more causes are listed in You can’t delete a file or a folder on an NTFS file system volume.

Matt Jacobs writes and maintains the guides on Support Your Tech, which he started in 2017. He spent most of his career keeping small-business PCs running and still takes the occasional consulting job, so the steps here come from fixing the same problems on other people’s computers. Every guide is checked on his own Windows 11, Windows 10, Mac, iPhone and iPad before it goes up.