How can we delete a file from Windows using Command Prompt

When you want to delete a file of an operating system WindowsWe can do this simply right-clicking it and selecting Delete displayed menu, or by selecting the file and pressing the respective Delete (In this way, the file will be sent to Recycle BinFrom which can then be permanently removed or the system may be restored if applicable).


In case you wish to delete the file directly (without first sending in Recycle Bin) Or use the key combination Shift + DeleteOr keep key pressed Shift while select Options Delete right-click menu of that file.


In some cases, however, it is possible that the file be locked system (I.e. a process or service running in background) And we can not delete. For such situations, we can use either a third-party application to force deleting file respectively, can be used Command Prompt.

How to delete a file from Windows using Command Prompt?

  • open Command Prompt cu privileges of administrator (type: cmd in Start Menu or Start ScreenThen right click on it and select Run ace administrator)
  • identified path the file you want to delete key pressed Shift and right-clicking it and then clicking Copy as path menu displayed
  • in Command Prompt type the command of the "file-path " (where file-path this path the file you want to delete; for example of the “D: \Stealth's \Desktop\ test.txt ”)
delete-file- cmd

If the file you want to delete is locked system, you can force deletion it from Command Prompt command of the / F “file-path " (e.g of / F “D: \Stealth's \Desktop\ test.txt ”).

force-delete-file- cmd

If you wish to wipe all files a folder, Type the command del / A "folder path" (Where path folder path this folder path to respectively; e.g., of / A “D: \Stealth's \Desktop\ folder ”), And type y for confirmation. Using this command only files contained in that folder will be deletedAnd not the folder itself (or any subfolders).


Note: If you delete a file from Windows using Command Prompt, it will be permanently deleted, without being sent to the Recycle Bin first (ie the file can no longer be recovered after deletion).

STEALTH SETTINGS - How to delete a Windows file using Command Prompt

how to » Noteworthy » How can we delete a file from Windows using Command Prompt

Passionate about technology, I like to test and write tutorials about operating systems Windows, always looking to discover interesting things.

Leave a Comment