Tricks Duniya -ONLINE SHOPPING GUIDE, MOBILE TRICKS, ANDROID TRICKS, HACKING
How To Force Delete File & Folder Using Command Prompt In Windows - Printable Version

+- Tricks Duniya -ONLINE SHOPPING GUIDE, MOBILE TRICKS, ANDROID TRICKS, HACKING (http://tricksduniya.com)
+-- Forum: COMPUTER ZONE (http://tricksduniya.com/forum-43.html)
+--- Forum: WINDOW TRICKS (http://tricksduniya.com/forum-51.html)
+--- Thread: How To Force Delete File & Folder Using Command Prompt In Windows (/thread-6571.html)



How To Force Delete File & Folder Using Command Prompt In Windows - Avishkar Singh - 11-16-2015

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 <File Path>


>> 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 <File path> 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 <Path of the Folder>


>> 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.