Want to delete files in a folder with one click? Or, are you an application developer looking to use a free way to delete files as part of a program? Just read this wikiHow article, and follow the steps!
Before Starting
- Open the Run dialog box by pressing Windows + R keys simultaneously, then enter "explorer" and press Enter.
- While the Windows Explorer window is active, press Alt.
- Click Tools > Folder Options
- In the Folder Options dialog box, click the View tab.
- Uncheck the "Hide extensions for known file types" option if it is checked.
-
Click OK.
Step
Step 1. Open Notepad by clicking Start > All Programs > Accessories > Notepad
Step 2. Insert "cd" into the Notepad window (without the quotes)
Step 3. Find the file or folder that you want to delete
Right-click the file/folder, then select Properties.
Step 4. Copy the information in the "Location" field of the "Properties" window
Step 5. In Notepad, press the space after "cd", then press the quotes and paste the information you have copied
End the information with quotation marks. For example, if you copy C:\users\Rhoma Rhythm, the information will be pasted as "C:\users\Rhoma Rhythm" (with quotes).
If you want to delete a file from a specific location, but the file in that location doesn't exist, start at step 3, and enter the file location
Step 6. Press Enter to start a new line in Notepad
Step 7. In the new line, enter "del" (without the quotes)
Step 8. Press space once, then enter the name of the folder or file you want to delete along with its extension (if any)
Begin and end the file name with quotation marks. For example, if you want to delete the "sugar" folder, enter del "sugar". Or, if you want to delete "young blood.3gp", enter del "young blood.3gp".
Step 9. At the top of the Notepad window, click File > Save As.
Step 10. In the Save As window, select the "All Files" option in the "Save as Type" field
Step 11. In the "File Name" field, enter "filename.bat" (without the quotes)
Replace "filename" with the name you want.
Step 12. Click Save.
Step 13. Locate the folder where you saved the batch file, then double-click the file
If you follow all the steps above correctly, the file you are referring to will be deleted.
If you receive the prompt and still want to delete the file, press "Y", then press Enter
Tips
- You can use wildcards in batch files. For example, if you want to delete the contents of a folder, use the * sign. If you want to delete all text files with the TXT extension in a folder, enter *.txt as the file name.
- To delete multiple files at once, repeat the above steps in the same Notepad document.