How to delete corrupted files Command Prompt

Download Article

Download Article

This wikiHow will teach you how to delete corrupted files on Windows and Mac using the administrator account, Safe Mode, and command prompt on Windows, as well as Terminal and Safe Mode on Mac. Usually, you can drag the file you want to delete into the recycling bin/trash can and empty that, but some files [like corrupted files] will cause errors when you try to delete them.

  1. 1

    Close all programs you were working on and restart your computer. If your account isn't an admin account, you may not have the permissions set up to delete certain files, so you'll need to login to an administrator account.

  2. 2

    Login to an administrator account. This account is usually denoted with [admin] under the username when you're at the user screen.

    Advertisement

  3. 3

    Locate the corrupted file you want to delete. You'll find it on either your desktop or in File Explorer.

  4. 4

    Drag the corrupted file to the Recycle Bin. This recycling can icon is usually on your desktop.

  5. 5

    Right-click the Recycle Bin icon. A menu will drop-down from your cursor.

  6. 6

    Click Empty Recycle Bin. This is usually the second option in the list next to another recycling bin icon.

    • If you continue to get an error, continue to the other methods.

  7. Advertisement

  1. 1

    Close all programs you were working on and restart your computer. You'll want to use this method if the previous steps did not work for you.

  2. 2

  3. 3

    Select Advanced options. You'll see this on the right side of your screen.

  4. 4

    Select Startup Settings and Restart. Your computer will restart again with Startup Settings.

  5. 5

    Enable Safe Mode. You'll need to press the corresponding number [1-9] or function key [F1-F9] to make your selection.

  6. 6

    Locate the file you want to delete. You'll find it on either your desktop or in your file explorer.

  7. 7

    Drag the file to the Recycle Bin. This recycling can icon is usually on your desktop.

  8. 8

    Right-click the Recycle Bin icon and select Empty Recycle Bin. The files inside the Recycling Bin should be deleted; if you continue to get an error, continue to the other methods.

  9. Advertisement

  1. 1

    Open Command Prompt as an Administrator. You can click the Start menu icon and type "cmd" to open a list of search results then click the Command Prompt program and click Run as administrator.

    • For this method, you need the file path of the file you want to delete. If you don't know how to get a file's file path, refer to How to Find a File's Path on Windows.

  2. 2

    Enter the following code into the command prompt window: "Del /F /Q /A "

    • Replace with your file's location. For example, you might have "Del /F /Q /A C:\Users\John\Downloads".
    • "/F" means to force delete files, "/Q" means to delete read-only files, and "/A" means to select files with the archiving attribute.[1]

  3. 3

    Press Enter. Your file should be deleted.

  4. Advertisement

  1. 1

    Click the Apple logo

    . You'll see this in the top left corner of your screen.

  2. 2

    Click Restart and press Shift. Hold down the Shift key as your Mac restarts to enable Safe Mode.

    • You can release the Shift key at the login window, as Safe Mode has been activated.

  3. 3

    Log into your account and locate the file you want to delete. Since your Mac is in Safe Mode, you might be able to delete the corrupted file.

  4. 4

    Drag the file to the Trash. You can also click to select the file in Finder, then go up to the menu and select Move to Trash.

  5. 5

    Empty Trash. Click and hold on the Trash icon. After a few seconds, a menu will pop up, and you can click Empty Trash.

    • Restart your Mac again to exit Safe Mode. If those steps still caused an error to pop up, try the next method.

  6. Advertisement

  1. 1

    Open Terminal. You can find the Terminal app icon in the Utilities folder of Finder.

  2. 2

    Enter the following code into the Terminal window, but don't press Return: "sudo rm -R ". You'll want to make sure you add a space after the last "R" in the code.

  3. 3

    Locate the file you want to delete in Finder. Make sure you can see your Terminal window at the same time.

  4. 4

    Drag the file you want to delete from Finder into the Terminal window. The file's location and name will add to the end of your command.

    • Press the Return key to delete the file.

  5. 5

    Enter the Admin password and press Return. This will prompt Terminal to permanently delete the file.

  6. Advertisement

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

Advertisement

Thanks for submitting a tip for review!

About This Article

Article SummaryX

1. Close all programs you were working on and restart your computer.
2. Log into an administrator account.
3. Locate the corrupted file you want to delete.
4. Drag the corrupted file to the Recycle Bin.
5. Right-click the Recycle Bin icon.
6. Click Empty Recycle Bin.

Did this summary help you?

Thanks to all authors for creating a page that has been read 51,415 times.

Is this article up to date?

How do I permanently delete corrupted files?

How to delete corrupted files?.
Close all programs and files you are editing..
Restart computer and then boot to Windows..
Log in Administrator account and find out corrupted files you want to delete. Drag files to Recycle Bin..
Empty Recycle Bin..

How do I force delete a file in Command Prompt?

Open elevated Command Prompt in Windows 10. Type del + file path command, press Enter to force delete file. Type rmdir /s /q + folder directory, press Enter to force delete folder Windows 10.

How do I delete unreadable and corrupted files?

Solution 2..
Step 1: Remove Corrupted Files and Delete the Folder. Move all the corrupted files to the folder with the locked file. ... .
Step 2: Close Windows Explorer to Erase Corrupted Files. ... .
Step 3: End the Task to Get Rid of Corrupted Files. ... .
Step 4: Restart Your Computer..

How do I clean up a corrupted file in Windows?

The sfc /scannow command will scan all protected system files, and replace corrupted files with a cached copy that is located in a compressed folder at %WinDir%\System32\dllcache. The %WinDir% placeholder represents the Windows operating system folder.

Chủ Đề