Want to delete files in a folder with one click? Are you an application developer who wants to make sure that his program can easily delete any file? Then this article is for you. Follow the steps in this article to get what you want.
Before you start
- Open the Run dialog box, type Explorer and press Enter. To open the Run dialog box, press Win + R on your keyboard at the same time.
- Press alt = "Image" on your keyboard (the explorer window should be active).
- Click on Tools> Folder Options.
- When the "Folder Options" window appears on the screen, go to the "View" tab.
- Uncheck the option "Hide extensions for registered file types", if it is there.
Step 1. Open Notepad
To do this, click on Start> All Programs> Accessories> Notepad.
Step 2. Enter "cd" (without quotes) into Notepad
Step 3. Find the folder or file you want to delete, then right-click on it and select Properties
Step 4. Copy the data from the "Location" line
Step 5. Go back to Notepad, put one space after "cd" and paste the copied information, enclosing it in quotation marks
For example, if you copied "C: \ Users \ Administrator", then the notepad will say "C: \ Users \ Administrator" (with quotes).
If you want to delete files from a specific folder, but the file is not there, start from the third step and enter its location
Step 6. Press Enter on your keyboard to move to another line
Step 7. Enter "del" (without quotes) in a new line of Notepad
Step 8. Put a space and enter the name of the folder or file with the extension (if it has one) that you want to delete, enclosing it in quotation marks
For example, if you want to delete the "Delete me" folder, then you need to enter the following: del "Delete me". If you want to delete the music.wav file, enter del "music.wav".
Step 9. At the top of the Notepad, click File> Save As
Step 10. In the "Save" window, in the "File Type:" line, select "All Files"
Step 11. In the "File name:" field, enter "your_name.bat" (without the quotes)
Replace "your_name" with the name of the file.
Step 12. Click "Save"
Step 13. Find the new file where you saved it and double click on it
If you did everything correctly, the file / folder will be deleted.
If a confirmation window appears, press Y or Enter on your keyboard
- Symbols can be used in this method. For example, if you want to delete the entire contents of a folder, replace the file name with "*". If you want to delete all files in the folder with the extension.txt (text format), instead of the file name, “*.txt” (without quotes) should be written.
- To delete multiple files at once, repeat the above steps in the same text document.