How to Force Delete a Stubborn File or Folder on Windows Computer? [6 Methods]

Steven
Written byStevenUpdated on May 10, 2025
Gerhard Chou
Approved byGerhard Chou

Table of Contents

Tip: If you couldn't delete a file or folder on your computer, you can use file shredder software - such as Donemax Data Eraser to force delete the file or folder. This software can securely and permanently delete files/folders from HDD, SSD, USB drive, SD card, digital camera, etc.

PAGE CONTENT:

Encountering a stubborn file or folder that refuses to be deleted is a common frustration for Windows users. Whether it's a file you no longer need, an incomplete download, or an old folder that you want to clear up, getting rid of these files can sometimes be surprisingly difficult. Users often face error messages such as "The file is in use," "Access is denied," or "File is corrupted," and these messages seem to block any attempt to delete them.

This issue can stem from various causes, including files being in use by background processes, corrupted files, lack of permissions, or even malware interference. Fortunately, there are several techniques and methods available to force delete these stubborn files or folders. In this article, we will explore why these issues occur and provide solutions ranging from simple to advanced methods for overcoming them.

force delete files on Windows

Common Reasons Why a File or Folder Won't Delete

Before jumping into the solutions, it's essential to understand why a file or folder may be resistant to deletion. The most common causes include:

1. File is in Use by a Program or Process

If a file or folder is open or in use by any program or background process, Windows may not allow you to delete it. This is especially common for files related to active software like video files being played in a media player or documents opened in a word processor.

2. Insufficient Permissions

If your user account doesn't have the required administrative permissions, you may not be able to delete the file. Some files and folders, especially system files, are protected from accidental deletion, and accessing them requires elevated permissions.

3. Corrupted Files or Folders

A corrupted file or folder may become unreadable or inaccessible, and Windows may prevent you from deleting it to protect system integrity. Corruption can occur due to a sudden shutdown, a system crash, or a failing hard drive.

4. Malware or Virus Interference

Malware or viruses often hide themselves in system files or folders to avoid being deleted. They may lock the file or even prevent it from being accessed at all.

5. Invalid File Name or Path

Sometimes files cannot be deleted due to issues with their names or paths. Files with excessively long names, invalid characters, or special characters that Windows doesn’t recognize can cause deletion problems.

6. Locked by the System or Third-Party Software

Files may be locked by running applications or system processes that are not obvious. These files may be part of a program that operates in the background or even a system process you're unaware of.

Quick Fixes for Can't Delete a File or Folder

Before diving into advanced methods, it's a good idea to attempt some basic fixes. These solutions can often resolve minor issues that are preventing file deletion.

1. Restart Your Computer

The first step when dealing with a stubborn file or folder is to restart your computer. Often, restarting frees up locked resources and terminates any processes that might be using the file or folder in question. After rebooting, try deleting the file again.

Restart Your Computer

2. Close Background Applications

If you suspect the file is being used by an application, check your Task Manager to ensure there are no background processes running that are using the file.

Steps:

  1. Open Task Manager by pressing Ctrl + Shift + Esc.
  2. Look for any programs or processes that might be using the file.
  3. Right-click and select End Task to stop them.

    Close Background Applications

  4. After closing the relevant application, try deleting the file again

3. Use Safe Mode

If a file still won't delete, booting into Safe Mode can help. Safe Mode loads Windows with minimal drivers and processes, often bypassing the issues preventing file deletion.

Steps to boot into Safe Mode:

  1. Type msconfig using Windows + R, then hit Enter.

    Type msconfig using Windows + R

  2. Select the Boot tab in the System Configuration window.
  3. Check the box labeled Safe boot, then click OK and restart your PC.

    Use Safe Mode

  4. Once in Safe Mode, try deleting the file again.

6 Advanced Methods to Force Delete a File or Folder

If basic fixes don't work, you can try advanced methods that require more technical intervention.

Method 1. Use Command Prompt (CMD) to Force Delete a File or Folder

Command Prompt offers powerful commands to delete files and folders, even if they're locked by a process.

Steps:

  1. Right-click and choose Run as Administrator to launch the Command Prompt as an administrator.

    launch the Command Prompt as an administrator

  2. To delete a file, use the following command:

    del /f /q "C:\Path\To\File"

    • /f forces the deletion of read-only files.
    • /q deletes the file quietly without prompting for confirmation.

    For example:

    Use Command Prompt (CMD) to Force delete a file

  3. To delete a folder and its contents, use:

    rmdir /s /q "C:\Path\To\Folder"

    • /s deletes all files and subfolders within the folder.
    • /q suppresses confirmation messages.

    For example:

    Use Command Prompt (CMD) to Force delete a folder

Note: The file or folder will be deleted immediately, you can't restore it from recycle bin.

Method 2. Use PowerShell to Force Delete File/Folder

PowerShell is a more advanced tool that offers greater flexibility. You can force delete a file using the Remove-Item command.

Steps:

  1. Start PowerShell in administrator mode.

    Start PowerShell in administrator mode

  2. To remove the file or folder, use the following command:

    Remove-Item -Path "C:\Path\To\FileOrFolder" -Force -Recurse

    • Force bypasses any restrictions.
    • Recurse is needed if deleting a folder with subfolders.

    For example:

    Use PowerShell to Force Delete File/Folder

Method 3. Use Windows File Explorer with Admin Rights

If you prefer a graphical user interface (GUI), you can try using Windows File Explorer with elevated administrative privileges.

Steps:

  1. To remove a file or folder, right-click on it.
  2. Click Advanced after selecting Properties and selecting the Security tab.
  3. Change the owner of the file or folder to your user account.
  4. Grant full control permissions by clicking Edit, then checking the box for Full Control.

    Use Windows File Explorer with Admin Rights

Once you have the necessary permissions, try deleting the file again.

Method 4. Use Task Manager to End Processes

If the file is locked by a system process, use Task Manager to stop the process.

Steps:

  1. Open Task Manager by pressing Ctrl + Shift + Esc.
  2. Look for any processes that may be using the file.
  3. Choose End Task with a right-click on the process.

    Use Task Manager to End Processes

  4. Try deleting the file after terminating the process.

Method 5. Take Ownership and Grant Full Permissions

Sometimes, files and folders may be protected by system-level permissions. In such cases, taking ownership of the file and granting full control permissions can allow you to delete it.

Steps:

  1. Choose Properties with a right-click on the file or folder.
  2. Click Advanced after selecting the Security tab.
  3. Click Change next to the owner field, type your username, and press OK.

    Take Ownership and Grant Full Permissions

  4. Grant full control by clicking Edit, then checking Full Control under your user account.

Once you have ownership and full control, attempt to delete the file again.

Method 6. Use Third-Party Tools to Delete the Files or Folders

If none of the above methods work, you can use third-party utilities designed to unlock and delete stubborn files and folders. These tools are especially helpful when the file is being locked by a third-party application or malware.

Popular Tools:

  • Donemax Data Eraser: Securely delete stubborn files and folders from local disk or external storage device.
  • Unlocker: A free tool that helps unlock files that are being used by other programs. It allows you to force delete, move, or rename the locked file.
  • IObit Unlocker: This tool works similarly to Unlocker but also offers a more user-friendly interface.
  • FileASSASSIN: A tool designed specifically to forcefully remove stubborn files that are resistant to deletion.

These utilities typically run in the background, identifying and unlocking the processes that are preventing file deletion.

For example, you can use Donemax Data Eraser to securely and quickly erase stubborn files and folders:

Step 1. Download and install Donemax Data Eraser, open it.

Step 2. Open Donemax Data Eraser, choose Erase Files mode, click Add button to select the stubborn files and folders you want to delete.

select the stubborn files and folders you want to delete

Step 3. Click on Erase Now button to permanently erase them.

Click on Erase Now button to permanently erase them

Note: Once the process gets finished, the selected files and folders are lost for good, can't be recovered by any method.

What Not to Do When Deleting Stubborn Files and Folders?

While it's tempting to use drastic methods, there are certain things you should avoid when dealing with stubborn files.

  • Don't delete system files: Deleting important Windows system files can result in a malfunctioning system. Always double-check that the file you're deleting is not a vital system file.
  • Avoid registry hacks: Modifying the Windows registry can cause unintended consequences. Always use caution when making changes to the registry, and back it up beforehand.
  • Don't force delete unknown files: If you're unsure about the nature of the file, it's best to investigate further before deletion. Some files may be critical for the operation of your computer or associated with malware.

Note: If you have deleted some important files by mistake and don't have a backup, you can use data recovery program - such as Donemax Data Recovery to recover the deleted and lost files.

Conclusion

Deleting a stubborn file or folder on Windows can be frustrating, but with the right tools and techniques, it's a solvable problem. From basic solutions like restarting your PC and using Safe Mode to advanced methods like using Command Prompt and third-party tools (such as Donemax Data Eraser), you have several options to force delete files that resist deletion.

Remember, always be cautious when deleting files - especially if they're related to the operating system or other essential applications. By following these guidelines and using the appropriate methods, you can clear your system of unwanted files safely and efficiently.

logo stage

Donemax Data Eraser

One of the best data erasure programs for permanently erase data from PC, Mac, HDD, SSD, USB drive, digital camera and other devices. Once the data is erased, it is lost for good, cannot be recovered by any method.

Steven
Contributing Writer

Steven

Steven has been a senior writer & editor of Donemax software since 2020. He's a super nerd and can't imagine the life without a computer. Over 6 years of experience of writing technical solutions and software tesing, he is passionate about providing solutions and tips for Windows and Mac users.

Gerhard Chou
Editor in chief

Gerhard Chou

In order to effectively solve the problems for our customers, every article and troubleshooting solution published on our website has been strictly tested and practiced. Our editors love researching and using computers and testing software, and are willing to help computer users with their problems