Security, PKI, sys and network admins

How to force delete a file or folder in Windows 10

How to force delete a file or folder in Windows 10

At some point in life, I needed to delete a folder and all of its files. But I wasn’t able to. The ordinary Delete key or Shift + Delete wouldn’t delete them. Not even when entering in “Command Prompt” – the error I was receiving was “The process cannot access the file because it is being used by another process.”

So, I decided to actually force deletion by entering “safe mode”.

1. Enter “safe mode”

In Windows 10, you can enter “safe mode” by:

  1. Pressing the Windows key (or just by clicking the Start button).
  2. Click the Power button.
    How to force delete a file or folder in Windows 10
  3. Press and hold the Shift key.
  4. Click Restart.
    How to force delete a file or folder in Windows 10

Now, your PC will restart/reboot and it will load in “safe mode”.

2. Enter “Command Prompt” in “safe mode”

  1. Move with arrow keys to “Troubleshoot”.
    How to force delete a file or folder in Windows 10
  2. Then to “Advanced options”.
    How to force delete a file or folder in Windows 10
  3. Choose “Command Prompt”.
    How to force delete a file or folder in Windows 10
  4. Choose your Windows user (in my case it’s “Neo”).
    How to force delete a file or folder in Windows 10
  5. Fill your user’s password.
    How to force delete a file or folder in Windows 10
  6. “Command Prompt” will show up.
    How to force delete a file or folder in Windows 10
    Inside “Command Prompt”, enter your desired partition/drive just by typing the letter of the drive. For example, in order to switch and enter the “E” partition/drive, you can just type E:. Once you’ve entered your partition/drive where you’ll want to delete the file/folder, you can:
    • use this command to force delete a file:
      del /f the_name_of_your_file
    • use this command to force delete a folder:
      rmdir /s the_name_of_your_folder
  7. Close “Command Prompt”.
  8. Choose “Exit and continue to Windows 10”.

Leave a Reply

Your email address will not be published. Required fields are marked *