7 ways to delete a file that cannot be deleted

Table of contents:

7 ways to delete a file that cannot be deleted
7 ways to delete a file that cannot be deleted
Anonim

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

Delete Files That Cannot Be Deleted Step 1

Step 1. Click the Windows start button

Windowsstart

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

Delete Files That Cannot Be Deleted Step 2

Step 2. Click the power off button

Windowspower

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

Delete Files That Cannot Be Deleted Step 3

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.

Delete Files That Cannot Be Deleted Step 4

Step 4. Wait for a blue screen to appear

You can release the Shift key when you see the blue screen.

Delete Files That Cannot Be Deleted Step 5

Step 5. Click the Troubleshoot button

It is symbolized by a tool icon and is located in the middle of the screen.

Delete Files That Cannot Be Deleted Step 6

Step 6. Click the Advanced Options button

It is on the troubleshooting page and its icon is three lines preceded by check marks.

Delete Files That Cannot Be Deleted Step 7

Step 7. Click Startup Settings

This option is in the right column of the next page and is symbolized by a gear wheel icon.

Delete Files That Cannot Be Deleted Step 8

Step 8. Click the Restart button

This is the button in the lower right corner of the screen.

Delete Files That Cannot Be Deleted Step 9

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

Delete Files That Cannot Be Deleted Step 10

Step 10. Open File Explorer

File_Explorer_Icon

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

Delete Files That Cannot Be Deleted Step 10

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.

Delete Files That Cannot Be Deleted Step 11

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

Delete Files That Cannot Be Deleted Step 12

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

Delete Files That Cannot Be Deleted Step 13

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.
Delete Files That Cannot Be Deleted Step 14

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

Delete Files That Cannot Be Deleted Step 16

Step 1. Click on the start menu

Windowsstart

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

Delete Files That Cannot Be Deleted Step 17

Step 2. Enter cmd in the search bar

You will see the command console icon displayed in the Windows start menu.

Delete Files That Cannot Be Deleted Step 18

Step 3. Open the command console in administrator mode

Right click on the command console

Windowscmd1

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

Delete Files That Cannot Be Deleted Step 19

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.

Delete Files That Cannot Be Deleted Step 20

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.
Delete Files That Cannot Be Deleted Step 21

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

Delete Files That Cannot Be Deleted Step 26

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.
Delete Files That Cannot Be Deleted Step 17

Step 2. Open File Explorer

File_Explorer_Icon

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.

Delete Files That Cannot Be Deleted Step 27

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.

Delete Files That Cannot Be Deleted Step 29

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.
Delete Files That Cannot Be Deleted Step 30

Step 5. Click Properties

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

Delete Files That Cannot Be Deleted Step 31

Step 6. Click the tab labeled Tools

You'll find it at the top of the menu that just popped up.

Delete Files That Cannot Be Deleted Step 32

Step 7. Click the Check button

It is located in the upper part of the window, in the frame titled Error checking.

Delete Files That Cannot Be Deleted Step 33

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

Delete Files That Cannot Be Deleted Step 34

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.

Delete Files That Cannot Be Deleted Step 31

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

Delete Files That Cannot Be Deleted Step 15

Step 1. Open the Apple menu

Macapple1

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.

Delete Files That Cannot Be Deleted Step 16

Step 2. Click Restart…

You will find this button in the drop-down menu displayed below the icon with the Apple logo.

Delete Files That Cannot Be Deleted Step 17

Step 3. Click Restart when prompted

Your Mac will begin to restart.

Delete Files That Cannot Be Deleted Step 18

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.

Delete Files That Cannot Be Deleted Step 19

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.

Delete Files That Cannot Be Deleted Step 31

Step 6. Open Finder

Macfinder2

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.

Delete Files That Cannot Be Deleted Step 20

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.

Delete Files That Cannot Be Deleted Step 21

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.
Delete Files That Cannot Be Deleted Step 22

Step 9. Click File

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

Delete Files That Cannot Be Deleted Step 23

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

Delete Files That Cannot Be Deleted Step 24

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.
Delete Files That Cannot Be Deleted Step 25

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

Delete Files That Cannot Be Deleted Step 44

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.
Delete Files That Cannot Be Deleted Step 45

Step 2. Type cd and press the Enter key

This will take you to the root directory of your system.

Delete Files That Cannot Be Deleted Step 46

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

Delete Files That Cannot Be Deleted Step 47

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

Delete Files That Cannot Be Deleted Step 48

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

Delete Files That Cannot Be Deleted Step 36

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.

Delete Files That Cannot Be Deleted Step 37

Step 2. Click Restart…

This button is located in the drop-down menu that is displayed.

Delete Files That Cannot Be Deleted Step 38

Step 3. Click Restart to confirm

Your Mac will begin to restart.

Delete Files That Cannot Be Deleted Step 39

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.

Delete Files That Cannot Be Deleted Step 53

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

Delete Files That Cannot Be Deleted Step 41

Step 6. Click Disk Utility

The icon for this button represents a stethoscope superimposed on a hard drive.

Delete Files That Cannot Be Deleted Step 42

Step 7. Click Continue

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

Delete Files That Cannot Be Deleted Step 43

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.

Delete Files That Cannot Be Deleted Step 44

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.

Delete Files That Cannot Be Deleted Step 45

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

Delete Files That Cannot Be Deleted Step 46

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.

Delete Files That Cannot Be Deleted Step 47

Step 12. Click Run when prompted

Disk Utility will begin to scan for problems with your hard drive and repair them if possible.

Delete Files That Cannot Be Deleted Step 48

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.

Delete Files That Cannot Be Deleted Step 49

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.
Delete Files That Cannot Be Deleted Step 63

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

Delete Files That Cannot Be Deleted Step 53

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.
Delete Files That Cannot Be Deleted Step 54

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.

Delete Files That Cannot Be Deleted Step 55

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.

Delete Files That Cannot Be Deleted Step 56

Step 4. Tap Storage Analyzer

This option is at the bottom of the list, just below the title Tools in the menu.

Delete Files That Cannot Be Deleted Step 57

Step 5. Tap on the icon

Android8refresh

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.
Delete Files That Cannot Be Deleted Step 58

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.

Delete Files That Cannot Be Deleted Step 59

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.

Delete Files That Cannot Be Deleted Step 60

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.

Delete Files That Cannot Be Deleted Step 61

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

Delete Files That Cannot Be Deleted Step 62

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.

Popular by topic