Most of the time, files that you cannot delete are in use by an operating system program or service. You can start your computer in safe mode to prevent as many programs and services as possible from running to resolve this problem. If the file is corrupted or if your computer informs you that it cannot find it, you may be able to resolve the problem by repairing the errors on your hard drive. On smartphones and tablets running Android, you can use third-party applications. You will need to be careful not to erase any files related to the operating system, because you will need to reinstall it completely.
Steps
Method 1 of 7: Erase Files in Safe Mode on Windows

Step 1. Click the Windows start button

This is the button with the Windows logo on the bottom left corner of your screen. You will see the start menu appear.

Step 2. Click the power off button

You'll find it in the lower left corner of the start menu. You will see a choice of shutdown or restart options.

Step 3. Restart your computer
To do this, hold down the Shift key and click Restart. Born don't let go the Shift key while your computer is restarting.

Step 4. Wait for a blue screen to appear
You can release the Shift key when you see the blue screen.

Step 5. Click the Troubleshoot button
It is symbolized by a tool icon and is located in the middle of the screen.

Step 6. Click the Advanced Options button
It is on the troubleshooting page and its icon is three lines preceded by check marks.

Step 7. Click Startup Settings
This option is in the right column of the next page and is symbolized by a gear wheel icon.

Step 8. Click the Restart button
This is the button in the lower right corner of the screen.

Step 9. Press the key to open secure mode
This is usually the key
Step 4.. Check the Startup Settings screen to which number the access corresponds to allows access to secure mode.
If key 4 does not work, try pressing F4. You may also need to press the Fn and F4 keys simultaneously

Step 10. Open File Explorer

When Windows has started in safe mode, open File Explorer by simultaneously pressing the ⊞ Win + E keys on your keyboard.

Step 11. Find the file you want to delete
Navigate to the directory where it is located using the file explorer. Double-click on the folder to open it.

Step 12. Select the file to delete
When you have opened the folder where it is located, click on the file to select it. It will then be highlighted in blue.
If you need to delete multiple files in the same folder, hold down the Ctrl key and select all of the files you want to delete by clicking on them

Step 13. Press the Eff key on your keyboard
All selected files will be moved at this time to the system recycle bin.
If you still cannot erase the selected files, you may need to repair your hard drive before trying to erase them again

Step 14. Empty the system trash
When you have put all the files you want to delete in the recycle bin, you can delete them permanently by doing the following:
- right click on the icon symbolizing the recycle bin;
- click on the option Empty the trash which is in the drop-down menu;
- click on Yes when prompted.

Step 15. Restart your computer
Proceed as follows to exit secure mode:
- click on To start up;
- click the power off button;
- click on the option To restart.
Method 2 of 7: Erase files from a Windows console

Step 1. Click on the start menu

This icon with the Windows logo is located by default in the lower left corner of your screen.

Step 2. Enter cmd in the search bar
You will see the command console icon displayed in the Windows start menu.

Step 3. Open the command console in administrator mode
Right click on the command console

displayed in the search results and then click Open as administrator. This will open the control console with system administrator privileges.
You must be logged into the system with an administrator account to run the console as such

Step 4. Type cd / and press the Enter key
This instruction will take you to the root directory of the system.
-
If you need to activate your console in another disk or partition, all you need to do is enter the disk identification followed by a colon :
after the system prompt. If your console is active in C: drive, you can connect to D drive by simply entering D:
following the prompt.

Step 5. Change the active directory
Enter the cd command that you will follow with the folder you want to go to and press the Enter key on your keyboard. This will take you to the folder where the file to be deleted is located. Separate each directory name from the tree you are following with a backslash \. Typing cd users \ name \ documents \ will take you to the documents folder, located on the second level of the users directory tree.
- To view a list of files and folders contained in a directory, type the command dir followed by pressing the Enter key on your keyboard.

Step 6. Delete a file
To do this, type the command del followed by the file name and its extension then press the Enter key on your keyboard. If you want to delete the file named myfile.txt, you will need to enter the command del myfile.txt.
- If the name of the file to which you want to apply a command contains one or more spaces, such as my file.txt, you will need to enclose it in quotes. To delete my.txt file you will have to type del my file.txt.
Method 3 of 7: Repair disk errors in Windows

Step 1. Close all open files
This is not strictly mandatory, but it will help you avoid possible problems while repairing disk errors. Be sure to save all documents while you are working and then close the application you were working with by clicking the icon in the form of X located at the top right of his window. You can also close active programs using the system task manager by doing the following:
- simultaneously press the Ctrl + Shift + Esc keys on your keyboard to open the task manager;
- select a running application by clicking on it;
- click on Stop the task.

Step 2. Open File Explorer

To do this, simultaneously press the keys ⊞ Win + E. The file explorer icon looks like a folder with a blue paper clip superimposed on it.

Step 3. Click This PC
This folder is located in the sidebar on the left of the File Explorer window. You will recognize it by its icon representing a computer monitor.

Step 4. Right click on your computer hard drive
This is usually the one labeled VS:, below the title Disks and peripherals. It can also be called OS (C:) or have the same name as your computer. You will see a drop-down menu below the name of your hard drive.
- If you don't see any disk name displayed, double-click on the header Disks and peripherals to see a list of all storage devices connected to your computer.
- If your computer has more than one hard drive, click the one where the file you want to erase is located.

Step 5. Click Properties
This option is located in the displayed drop-down menu. You will see a menu open.

Step 6. Click the tab labeled Tools
You'll find it at the top of the menu that just popped up.

Step 7. Click the Check button
It is located in the upper part of the window, in the frame titled Error checking.

Step 8. Check the hard drive
To do this, click Check Disk when prompted. This will allow Windows to check the disk for errors.
If the system detects any errors, they will be repaired automatically if possible

Step 9. Perform the error check
The process can take anywhere from a few minutes to several hours. This will depend on the size of the drive the search is running on and the number of errors that will be detected.

Step 10. Try again to erase the recalcitrant file
Now that you have fixed the problems with your hard drive, you should be able to erase the files that were locked due to these troubles. Navigate to the recalcitrant file with your explorer and click on it to select it, then press the Delete key to delete it.
- You may need to erase this file in Safe Mode if it is in use by a Windows program or service.
- If you still cannot delete this file, it is probably because it is locked by another user on the system or is part of the operating system. Either way, you won't be able to erase it.
Method 4 of 7: Erase Files in Safe Mode on Mac

Step 1. Open the Apple menu

To do this, click on the icon that bears the Apple logo and is located in the upper left corner of your screen, in the menu bar. You will see a drop-down menu.

Step 2. Click Restart…
You will find this button in the drop-down menu displayed below the icon with the Apple logo.

Step 3. Click Restart when prompted
Your Mac will begin to restart.

Step 4. Hold down the Shift key on your keyboard
Be sure to do this immediately after clicking the restart button and definitely don't release it.

Step 5. Wait for the login window to appear
When this window appears, you can release the Shift key. This will allow your Mac to restart directly in Safe Mode rather than using the startup settings to do so.

Step 6. Open Finder

To do this, click on the blue and white smiley face icon in your system's application bar at the bottom of the device screen.

Step 7. Navigate to the file you want to erase
Use Finder to navigate to the folder where the file you want to delete is located, then double-click to open it.

Step 8. Select the file to delete
Click on the file you want to delete to select it. You will see its icon display in blue.
- If you want to delete several files from the same directory, you can keep the key pressed. Command while you click on each of the documents to be deleted.

Step 9. Click File
This button is at the top of your screen. You will see a drop-down menu.

Step 10. Click the Move to Trash option
Clicking on this option in the drop-down menu will move the selected files to the system recycle bin.
If you are unable to erase the selected files, you may need to repair your Mac hard drive before trying to erase them again

Step 11. Empty the system trash
When all the files you wanted to delete are placed in the recycle bin, follow these steps to delete them permanently:
- click and hold the trash can icon;
- in the contextual menu that will appear, click on Empty the trash;
- when prompted, click Empty to confirm.

Step 12. Exit Secure Mode and restart your Mac
To do this, proceed as follows:
- click on the menu Apple;
- click on To restart…;
- when prompted, click To restart to confirm.
Method 5 of 7: Erase files from a Mac or Linux terminal

Step 1. Open a terminal
The terminal icon appears as a black screen with a text cursor superimposed on it. Follow these steps to open a terminal on Mac:
- click on the magnifying glass icon in the upper right corner of the screen;
- type Terminal in the search bar;
- click on the icon symbolizing the terminal.

Step 2. Type cd and press the Enter key
This will take you to the root directory of your system.

Step 3. Navigate to the directory in which you will be working
Type the command cd ~ / followed by the directory tree where the file to be deleted is located and press Enter on your keyboard. Separate each directory in the tree with a slash (/). Be sure to respect the box corresponding to that of the folder names that you will place on the command line. If you want to navigate to the directory named Documents, you will need to type cd ~ / Documents after the command prompt.
To display the list of files and folders contained by the current directory, you can type the ls command followed by pressing the Enter key on your keyboard

Step 4. Delete a file
To do this, type the rm command followed by a space, the name of the file to be deleted and then press the Enter key on your keyboard. To delete the MyFile.txt file, type, rm MyFile.txt.
If the file name contains one or more spaces, enclose it in quotation marks. Type rm "My File.txt" to delete the My File.txt file from the current directory

Step 5. Confirm your intention to delete the file
You will need to confirm your intention to delete a file if it is write-protected. To do this, type o at the prompt and press the Enter key on your keyboard.
You can force the file to be deleted without having to give confirmation by following the rm command with the -f switch. To force the deletion of the My_file.txt file, you will have to type rm -f My_Fichier.txt. Applying this switch is most useful when multiple files need to be erased one after the other in a batch erase command
Method 6 of 7: Repair Disk Errors in Mac

Step 1. Open the Apple menu
Click on the icon with the Apple logo at the top left of your screen. You will see a drop-down menu.

Step 2. Click Restart…
This button is located in the drop-down menu that is displayed.

Step 3. Click Restart to confirm
Your Mac will begin to restart.

Step 4. Hold down the ⌘ Command + R keys
Simultaneously press these keys until you hear the ringtone indicating the start of restarting your Mac. Do not release them until you see the Apple logo.

Step 5. Release the keys as soon as the Apple logo appears
This will load the system recovery menu.
The recovery menu may take a few minutes to load

Step 6. Click Disk Utility
The icon for this button represents a stethoscope superimposed on a hard drive.

Step 7. Click Continue
This button is located in the lower right corner of the screen. You will see the Disk Utility window open.

Step 8. Click the tab labeled View
You will find it in the menu bar at the top of the window. You will see a drop-down menu.

Step 9. Click the Show all devices option
It can be found in the drop-down menu. In the left column of the screen you will see a list of all the drives connected to your Mac.

Step 10. Select your Mac's hard drive
You will find it displayed in the left column of your screen.
If your Mac has more than one hard drive, select the one with the file you want to erase

Step 11. Click on the tab labeled S.O.S
Its icon represents a stethoscope and can be found in the menu bar at the top of the window.

Step 12. Click Run when prompted
Disk Utility will begin to scan for problems with your hard drive and repair them if possible.

Step 13. Erase files if prompted to do so
If the application notifies you of extended allocation overlay errors, it will ask you to take appropriate action. In this case, you will be given the option to erase all damaged or corrupted files which will be displayed in a list. If you see the file there that you wanted to delete, delete it before proceeding further.

Step 14. Restart your Mac
When Disk Utility is finished, do the following:
- click on the Apple icon;
- click on To restart…;
- click on To restart to confirm.

Step 15. Try to delete the file again
Now that you have fixed all the bugs in your hard drive, you should be able to erase any files that were locked for this reason. Open Finder to go and select the file you want to delete by clicking on it, move it to the recycle bin and then delete it permanently.
- You may need to use safe mode to erase it if it is linked to a program that is running by default.
- If you still cannot delete this file, it is probably because it is locked by another user on the system or is part of the operating system. Either way, you won't be able to erase it.
Method 7 of 7: Erase Files with SD Maid on Android

Step 1. Download and install SD Maid
This is a systems cleaning utility for Android. It can help you delete files that you cannot delete with the My Files application. Be aware that you should not and will not be able to erase certain files on Android because they are part of the system root or are related to the operation of a specific application. Follow these steps to download SD Maid:
- open the repository of Google Play applications;
- enter SD Maid in the search bar at the top of the screen;
- type the link titled To install below the application name.

Step 2. Open SD Maid
The SD Maid icon has the appearance of an Android robot wearing a waitress apron. To open this application, Tap on the icon that you will find on your home screen or in the applications menu, otherwise tap on To open in the applications repository.

Step 3. Tap ☰ to open the menu
Tapping on this three horizontal bar icon in the upper left corner of your screen will open the menu.

Step 4. Tap Storage Analyzer
This option is at the bottom of the list, just below the title Tools in the menu.

Step 5. Tap on the icon

This is a green circular arrow button located in the lower right corner of your screen. Its function is to examine the file system of your Android device.
- The first time you use this feature, you may be asked to allow the app to access your device's internal storage system as well as the SD card it is equipped with. If you are prompted to allow your system access to SD Maid, tap the button To allow to continue.

Step 6. Tap on the storage device containing the file to be deleted
The public disc labeled Primary is the internal storage unit of your smartphone or tablet and the one labeled Secondary represents his SD card. Tap on the drive containing the file you want to delete.

Step 7. Navigate to the file you want to delete
Tap on the folders displayed on the screen to open them. Files associated with a specific application are usually placed in a folder with its name. Those containing images are in the folder named DCIM or Images, and those that have been downloaded from the Internet will be placed in Downloads. Documents that do not have a specific category will generally be found in the directory named My Documents.

Step 8. Select the item to erase
Tap and hold your finger on the file or folder you want to delete to select it. You will see a bar displayed at the top of the screen.

Step 9. Tap on the trash can icon
You will find it in the upper right corner of your screen. This action deletes the selected file or directory.
When you have deleted the file with SD Maid open the My Files or Files application to verify that it has been deleted. If not, try deleting it directly with My Files, this may be possible after you delete it with SD Maid

Step 10. Make a backup and reset your Android smartphone
Unfortunately, not everything always works on Android. If you can't delete a file, try backing up the contents of your smartphone or tablet and then reset your device. You can restore your smartphone from the backup you just made, after reinstalling its operating system. This should only be done as a last resort and if and only if you want to get rid of the recalcitrant file.
Advice
- Safe Mode was designed to disable most programs and services on your system so that functions such as deleting recalcitrant files can be performed without interference from other programs.
- System files like DLL libraries are responsible for most of the system's functions and the appearance of its graphical interfaces.