Windows OS

5 Fixes for Can’t Delete File or Folder in Windows

Have you ever tried to delete a file/folder in Windows and faced a “Can’t delete file or folder” error? This happens because Windows has been blocked from responding to your requests, you don’t have permission to do so, or the file/folder is corrupt. Most of the time, you can come out of this frustrating situation by rebooting Windows. However, if reboot didn’t help, then go for the other solutions.

This write-up aims to fix the “Can’t delete file or folder” error.

How to Fix “Can’t Delete File or Folder” in Windows?

The stated error can be rectified by utilizing the below-mentioned approaches:

Fix 1: Enable Safe Mode

The first approach towards fixing the error is to enable the “Safe mode”. For that reason, firstly, reboot the system. Wait for the boot screen window to appear. Press the “F8” button frequently till the “Advanced options” show up. After that, move to the “Troubleshoot>Advanced options>Start-up Settings” path and hit the “Restart” key:

Then, press the “F4” key to boot Windows in safe mode:

Windows will reboot in safe mode, allowing you to delete problematic files/folders.

Fix 2: Change Ownership of File/Folder

Changing the ownership of the problematic folder/file can also fix the stated problem. To do so, first, right-click on the required file/folder and select “Properties” from the context menu:

Navigate to the “General” tab and copy the file/folder path:

Launch “CMD” as an administrator via the Start menu:

Then, execute the “TAKEOWN” command as it permits the system administrator to recover the file access by making it the file owner:

>TAKEOWN /F "location of the file or folder\ file or folder name" /R /D Y

The above command utilizes the following parameters:

  • /F” indicates the full file path.
  • /R” changes the owners of all the nested files and folders recursively.
  • /D Y” is added to change the file owner.

Run the below code in the terminal:

>TAKEOWN /F "C:\Users\Muhammad Farhan\Documents" /R /D Y

The ownership of the file/folder has been changed. Now, you can easily delete the required file/folder.

Fix 3: Use WinRAR

The corrupted file/folder can also be deleted by using WinRAR. To do so, right-click on the file or folder and select the “Add to archive” option:

Navigate to the “General” tab. Mark the “Delete files after archiving” checkbox, and hit the “OK” button to start archiving the file/folder:

As you can see, the file is archived successfully:

Right-click on the archived folder and select the “Delete” option:

Select “Yes” to confirm the deletion operation:

As a result, the file or folder will get deleted successfully.

Fix 4: Use CMD

The CMD can also be utilized to rectify the specified error. For this purpose, right-click on the desired file/folder and select “Properties”:

Navigate to the “General” tab, and copy the file/folder path:

Execute the “DEL” command to delete the required file from the dis:

>DEL /F /Q /A "C:\Users\Muhammad Farhan\Documents\File.txt"

In the above command:

  • /F” option forces the deletion of the read-only file.
  • /Q” option specifies the quiet mode.
  • /A” is an additional option utilized to delete all files(when you want to delete a folder).

Fix 5: Repair System Files

The corrupt system files can also create a problem in deleting a file/folder. Running the system file checker scan will assist in rectifying the specified error. To do so, run the below “sfc” command with the “/scannow” option in the terminal to initiate the scan:

>sfc /scannow

We have compiled the authentic methods for fixing the file or folder deletion issue in Windows.

Conclusion

In Windows, the “Can’t delete file or folder” error can be fixed by adopting several approaches. These approaches included enabling safe mode, changing ownership of the file/folder, using WinRAR, executing some commands on CMD, or repairing system files. This blog post has exhibited numerous approaches to fixing the stated issue.

About the author

Muhammad Farhan

I am a Computer Science graduate and now a technical writer who loves to provide the easiest solutions to the most difficult problems related to Windows, Linux, and Web designing. My love for Computer Science emerges every day because of its ease in our everyday life.