Delete All Files in a Folder Windows 10: Full Guide
In this article
- Why You Might Need to Delete All Files in a Folder
- Method 1: Select All and Delete (Simplest)
- Method 2: Delete Only Certain File Types (Using Search)
- Method 3: Using Command Prompt or PowerShell
- Recycle Bin vs Permanent Deletion: What’s Safer?
- Common Problems and How to Avoid Them
- Alternatives: Storage Sense and Third-Party Tools
- Frequently Asked Questions
To delete all particular files inside a folder in Windows 10, open the folder in File Explorer, press Ctrl + A to select everything, then press Shift + Delete to permanently remove them without sending to the Recycle Bin. If you only want to delete files of a certain type (like .jpg or .tmp), use the search box in the top-right corner to filter by extension, select the results, and delete them.
Why You Might Need to Delete All Files in a Folder
Over time, folders accumulate clutter: temporary files, old downloads, duplicate documents, or leftover installation files. Manually selecting and deleting hundreds of items is tedious and error-prone. Windows 10 offers several built-in methods to clear an entire folder’s contents quickly, whether you want everything gone or only specific file types.
Common scenarios include cleaning a Downloads folder, clearing a temp folder, removing all screenshots from a project folder, or wiping a folder before reusing it. Each method has trade-offs in speed, safety, and whether the files go to the Recycle Bin or are permanently erased.
Method 1: Select All and Delete (Simplest)
The most straightforward way is to select every item in the folder and delete it. This works for both files and subfolders.
- Open the folder in File Explorer.
- Click anywhere inside the folder window (so it has focus).
- Press Ctrl + A to select all items. You can also click Home tab → Select all.
- Press Delete to move items to the Recycle Bin, or Shift + Delete to permanently delete them (a confirmation prompt will appear).
If you want to delete everything except a few files, hold Ctrl and click the items you want to keep to deselect them, then delete the rest.
Method 2: Delete Only Certain File Types (Using Search)
Sometimes you only want to delete files with a specific extension, like all .log files or all .tmp files. The search box in File Explorer makes this easy.
- Open the folder.
- Click in the search box (top-right corner).
- Type
*.ext(replaceextwith the actual extension, e.g.,*.tmp). Press Enter. - Windows will show only files matching that pattern (including those in subfolders if you enable that in the Search tab).
- Press Ctrl + A to select all results, then press Delete or Shift + Delete.
You can also combine criteria, like *.log AND datecreated:>2023-01-01, to narrow further. For multiple extensions, use *.tmp OR *.log.
Method 3: Using Command Prompt or PowerShell
For advanced users, command-line tools offer more control, especially for deleting files in bulk or from many folders at once. Open Command Prompt or PowerShell from the Start menu (type “cmd” or “PowerShell”, right-click, and select “Run as administrator” if needed).
To delete all files in the current folder (but not subfolders):
del *.*
To delete only files with a specific extension:
del *.tmp
To delete all files and subfolders recursively (use with extreme caution):
rmdir /s /q "C:\path\to\folder"
Replace the path with your actual folder. The /s flag removes all subfolders and files, /q suppresses confirmation prompts. This permanently deletes everything with no Recycle Bin recovery.
Recycle Bin vs Permanent Deletion: What’s Safer?
When you press Delete, files go to the Recycle Bin, which you can restore later if you change your mind. This is the safer option for accidental deletions. However, the Recycle Bin still occupies disk space until you empty it.
Pressing Shift + Delete bypasses the Recycle Bin entirely. The files are marked as free space and can be overwritten by new data. If you need to recover them later, you’d need third-party recovery software, and success isn’t guaranteed. For sensitive data, consider using a secure deletion tool, but for routine cleanup, the Recycle Bin is fine.
Common Problems and How to Avoid Them
- “Access Denied” errors: Some files are in use by a running program or require administrator permissions. Close any apps that might be using the files, or run File Explorer as administrator.
- Deleting system files: Never delete files in C:\Windows or Program Files unless you know exactly what they are. Stick to user folders like Downloads, Documents, or your own project folders.
- Accidentally deleting subfolders: The methods above delete everything inside the folder, including subfolders. If you only want to delete files (not folders), use the search method with
*. *but that also includes folders. To exclude folders, use Command Prompt:del /s *. *will delete files in subfolders but keep the folder structure. - Hidden files not selected: By default, File Explorer hides certain system files. If you want to delete everything, enable hidden items via View tab → Hidden items checkbox.
Alternatives: Storage Sense and Third-Party Tools
Windows 10 includes Storage Sense, which can automatically delete temporary files and empty the Recycle Bin on a schedule. Go to Settings → System → Storage → Storage Sense to configure it. This is a good option for routine cleanup.
For more advanced filtering (e.g., delete files older than X days, or larger than X MB), you can use PowerShell scripts or third-party file managers. A simple PowerShell command to delete files older than 30 days in a folder:
Get-ChildItem -Path "C:\path\to\folder" -Recurse | Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-30) } | Remove-Item -Force
This is powerful but requires careful testing. Always test on a sample folder first.
Frequently Asked Questions
How do I delete all files in a folder but keep the folder itself?
Use Ctrl + A to select all items, then press Delete. The folder itself remains, only its contents are removed. If you accidentally delete the folder itself, you can recreate it with New Folder in the parent directory.
Can I recover files deleted with Shift+Delete?
Possibly, using third-party recovery software like Recuva or EaseUS Data Recovery Wizard. However, the sooner you stop using the drive, the better the chances. Files deleted this way are not in the Recycle Bin, so the space is marked as free and can be overwritten.
Why does my folder show “0 items” but still has files?
This usually happens when hidden files are present. Enable View → Hidden items in File Explorer to see them. Alternatively, open Command Prompt in the folder and type dir /a to list all files including hidden and system ones.
How do I delete all files in a folder using keyboard only?
Open the folder, press Ctrl + A, then Shift + Delete (or just Delete to send to Recycle Bin). Press Enter to confirm the permanent deletion prompt.
What’s the difference between deleting files and formatting a drive?
Deleting files removes them from the folder but leaves the drive’s file system intact. Formatting a drive erases all data and rebuilds the file system, making it essentially empty. Formatting is more thorough but also wipes everything, including system files if it’s the C: drive.
Is there a way to undo a mass deletion?
If you used Delete (to Recycle Bin), you can open the Recycle Bin, select the items, and click Restore. If you used Shift+Delete, there is no built-in undo; recovery requires third-party software as mentioned above.