How to Force Delete a File in Windows Using Command Prompt

Configurare noua (How To)

Situatie

Trying to delete a stubborn file or folder from your Windows PC can be frustrating. For example, you could be pressing delete and thinking the file or folder is gone, only to find it in the exact location you removed it from.

There are several reasons why you can’t delete a file or folder, including:

  • The file may be in use by another program, background process, or application.
  • The file’s unlock process may not have been completed.
  • Disk failure or corruption.
  • The folder or file is read-only or corrupted.
  • You may be trying to delete a system file.
  • The Recycle Bin is either full or corrupted.
  • The file or folder is infected with malware or a virus.
  • The disk is write-protected or full.
  • You get the Access Denied warning when you try deleting files or folders from a mounted external drive.

Command Prompt in Windows PCs can perform advanced administrative functions, automate tasks via batch files and scripts, and troubleshoot issues in Windows.

Solutie

Pasi de urmat

Type CMD in the search box and select Run as administrator.

Type cd x:\ and press Enter. In this case, x represents the name of the drive letter, where the folder containing the file you want to force delete resides.

Type del filename and press Enter. Make sure you replace the filename with the name of the file you want to delete in Windows.

Alternatively, type the command as del /F c:\users\thispc\desktop\filename to force delete the file if it is read-only. In this case, you’ll enter del plus your the /F parameter, the file’s location, and the filename, which would look something like this: del /F c:\admin\thispc\desktop\deletethis.

Tip solutie

Permanent

Voteaza

(3 din 9 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?