Corrupt files are where there are issues with the content of a file such that you cannot open or use it properly. Furthermore, a corrupt file may cause loss of data and cause issues with your hard drive, so they are best deleted as soon as you detect one. If you can drag the file to the recycle bin/trash or right-click and move it to trash brilliant, you are halfway there.
Once it is in the recycling bin, empty the recycling bin and that is the problem gone.
If only it were always so easy …
In reality, corrupt files although becoming rarer are a pain. Most will not delete using simple measures and will sometimes more than one attempt at various methods. Below we will discuss what your next steps should be if simply moving the file to trash does not work for you – both on a Windows 10 and a Mac device.
Table of Contents
Deleting Corrupt Files on Windows 10
You have four options for deleting the file. These are as follows:
- Force delete using a keyboard shortcut
- Attempt to delete it from an Admin account
- Restart your computer and login to Safe Mode and attempt deleting from there
- Using the Command Prompt to force delete the file
We will discuss these in order, but please use the Command Prompt route with extreme caution. We will explain why when you get there. The other routes are just a little less terrifying.
Using a Keyboard Shortcut
This is a sweet and easy way to permanently delete files bypassing the recycling bin. Not many people are aware of it, and it is useful both for normal functioning and corrupt files. With corrupt files, the operation of copying the file to the recycling bin may be what was stopping its deletion in the first place, and therefore this may immediately solve the problem.
Follow these steps to use the force delete shortcut:
- Single-click the file to highlight it
- Press Crtl + Delete
- Confirm that you want to permanently delete the file by clicking yes in the pop-up that appears
Deleting from an Admin Account
Occasionally you do not have the correct credentials on your account to delete files in certain locations, if this is the case then an account admin needs to log in and attempt deleting the file. Here is how to do it:
- Close all open windows and applications including the file explorer
- From the start menu (Windows icon) select switch user
- Ask the device admin to login and advise them of which file needs deleting
- Here they can attempt to delete it by dragging into the recycling bin, right clicking and selecting move to trash or by using Crtl + delete as discussed above
- If the file is moved to recycling bin rather than deleted permanently by using Ctrl+ delete then the admin will also need to empty the recycling bin
Starting your Machine in Safe Mode
Ok, so this is not often needed and how to do it has significantly changed over the last few years. On the plus side if the corrupt file were causing so much trouble that you couldn’t start your computer normally or if things just kept freezing/crashing then this is an excellent option as safe mode is a limited version of the operating system which will start even when there are significant ongoing issues with the hard drive.
Follow these steps to access safe mode;
- From the login screen (access this by for example selecting switch user in the start menu or if you’ve just started the computer before you login to your account)
- Press and hold Shift then click the power button on the screen (located in the right bottom corner) it gives you three options -> Select Restart
- This time when you restart, you’ll be given a menu of options, select Troubleshoot
- Another menu will appear here select Advanced Options then select Startup Settings
- Click next to see the startup settings options -> A list will appear, press number 4 on your keyboard which will then start your computer in safe mode
See images below for details.
Once you have completed step four by selecting startup settings you will be taken to the screen on the right, just click next/ continue from here to then go to the left-hand side screen. Here the best option for our purpose is number 4, Enable Safe Mode -> click the number 4 on your keyboard.
It is worth noting that if you have a Bluetooth-connected mouse or keyboard or connected via Bluetooth to a USB port these may not work once you’ve started the computer in safe mode.
Once you have started the computer in safe mode, log in to your account. Located the corrupt file and go through the process of deleting it with any of the methods discussed above. Remember to empty the recycling bin if you are moving the file through there.
Using the Command Prompt
We really hoped something would work before this step and to be honest maybe it’s worth talking to your admin or windows support before proceeding. Although it is not particularly difficult, it can go terribly wrong if you are not careful so please read the instructions until the end, not once but at least twice, double-check the file path at least twice and make sure it’s accurate and complete. If you accidentally delete a whole directory, you will not be able to recover this so really pay attention.
Ok so here’s how to do it, for the easiest least likely to cause a disaster way;
- Have the full string of the file path to the document or folder you want to delete to get the file path follow these steps:
- Right click the file and select properties.
- Under the general tab you will need to copy the file location (highlighted in the image)
- Paste the location into a word processing document such as word then add a back slash (“\”) after which type the file name and extension type as follows:
- C:\Users\T\Documents\Corrupt.txt (in this instance the file to be deleted is a text file (txt) named Corrupt).
2. Ok, now you’ve got the string we can open the Command Prompt, to do this type the letters “cmd” into the search box on the left-hand side next to the windows icon, then click open on the right
3. The command prompt will open, you will now need to paste the following string of code, followed by the file path of the file you want to delete: DEL /F /Q /A “File Path” using double quotes around the path as you will run into serious trouble if there is a space in the file name without. See image below for how it will look:
4. Ok if you’ve got this far and you are sure that the file path is correct then hit enter and the file will be deleted.
The reason to be extremely careful about the file path is that if there is a space within the file name and you do not use the double-quote or if you copy the location without adding the file name in the end you can accidentally delete a whole directory such as your documents folder which may contain important files you can’t replace. Remember that this is a permanent delete. If you have read this a couple of times and still feel unsure then maybe it’s best to leave it until you can ask for help.
Sorry we do not want to scare anyone, but also don’t want you to accidentally delete a bunch of stuff you might need.
So that was windows, onward to how to do this on a Mac.
Deleting Corrupt files on a Mac
If you have attempted to delete the file the way you would normally and it has not worked then it’s time for one of two options:
- Restarting your Mac in Safe Mode and attempting to delete the file again
- Deleting the file through the terminal
Starting Your Mac in Safe Mode
As a Mac owner you have it relatively easy, starting your Mac in safe mode is not much different to restarting it. Follow the steps below:
- Click on the Apple symbol in the top left corner
- Select Restart in the menu
- Click and hold Shift -> keep holding until the login window appears
- Log into your account as you would normally
- Navigate to the file and drag it into the trash icon on your dock (alternatively right click and select move to trash)
- Right click the trash icon and select Empty Trash
- If all has worked well then restart your Mac this time without pressing shift
If the file did not delete or you weren’t able to empty the trash you may need to use the next method to get rid of it for good.
Deleting a Corrupt File Through Finder
Macs are practically indestructible, so you have really got yourself a stubborn problem if you have to go this far to delete your evil file. The good thing about Macs though is that even the terminal is foolproof and user-friendly so no need to fear to the same extent as those poor windows users when they need to use the command prompt.
Okay, ready? Lets to it:
- Open your utilities folder in Finder
- Open the Terminal application which you will find in there
- There will be some text on you’re the first line, after this text type or paste the following code: sudo rm -R
- Make sure to leave a space after the capital R
- Open Finder by the side of your Terminal so you can see both windows and locate the file you want to delete (if the file is on the desktop, then just move the terminal so you can see it)
- Drag the file into the terminal next to the capital R, a string will appear which will denote the location and the name of the file you want to delete -> Press Enter
- The terminal may ask for an admin password after you press Enter, if it does enter your password and press Enter again
- The file should be deleted, and all should be well again
If this does not work, it may be time for a visit to your local Apple Shop. We’re sure that apart from having your computer seen after you’ll enjoy ogling the displays and wondering when on earth you can afford and justify more apple products as you do.
Conclusion
Although that was lengthy, we hope you found what you were looking for and that you were able to delete the evildoer from existence. If all else fails and you have no way of seeking assistance, then you might need to back up your files and factory reboot your computer. It shouldn’t come to that.