Tricks Duniya -ONLINE SHOPPING GUIDE, MOBILE TRICKS, ANDROID TRICKS, HACKING

Full Version: How To Force Delete File & Folder Using Command Prompt In Windows
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
One of these things where the command prompt might be your ultimate hope, is when your computer gets infected and once you’ve cleaned it, no matter how long you try, there remain many files and folders that would simply refuse to be deleted.
It becomes extremely important to delete these files as there will be a chance of the infection recurring.

You can even use the command prompt on windows to delete files which are refusing to be deleted via the windows explorer. Here’s how you can use the command prompt on windows to forcefully delete files and folders.




## How to Delete a Single File Using the Command Prompt in Windows??

Step 1: Run the Command prompt on windows. (Windows + R, type CMD)

Step 2: Now you will need to type the following into the command line and press enter.

DEL /F /Q /A


>> Where ——
/F parameter stands or force deletion of files
/Q parameter ensures the Forces deletion of read-only files
/A parameter will select only the files with the ready for archiving attribute
this thing is you have to replace with the path of the file or folder.

>> For example ——
DEL /F /Q /A C:\Users\TricksDuniya\xyz.txt


Step 3: After entering this line , hit Enter & your file will get deleted successfully.





## How to Delete a Folder Using the Command Prompt in Windows??

Step 1: Run the Command prompt on windows. (Windows + R, type CMD)

Step 2: Now you will need to type the following into the command line and press enter.

RD /S /Q


>> Where ——
RD stands for Remove Directory
/S deletes all subfolder and files
/Q Deletes directories without confirmation.

>> For example ——
RD /S /Q C:\Users\TricksDuniya\Folder


Step 3: After entering this line , hit Enter & your file will get deleted successfully.





NOTE :- Use this method if you are familiar with the command prompt. If the instructions are not followed properly, you might accidentally delete something else.