Add “Empty Folder Contents” To Vista Right Click Context Menu To Delete Files Without Removing Folders
There may be need for Windows user to quickly delete and empty all files content inside a myriad hierarchy of folders, but maintaining and preserving the structure of the folders tree. In other words, user wants to just delete and remove the files, but not the folders that storing the files. There is a trick to add “Empty Folder Contents” contextual item into right click context menu (much like how user access the “Delete” function) in Windows XP, which works on Windows Vista, also Windows Server 2003 and 2008 as well.
To enable the “Empty Folder Contents” right click context menu command, just follow these steps:
- Run Registry Editor (regedit).
- Navigate to the following registry key:
HKEY_CLASSES_ROOT\Directory\shell
- Right click on shell folder, and then choose New -> Key. Name the new subkey as Empty Folder Contents, or anything you would like.
- Right click on Empty Folder Contents and choose New -> Key. Name the sub-key as Command.
- Under the Command sub-key, double click on the Default value data that is located at right pane.
- On the pop-up “Edit String” dialog window, enter the following value:
cmd /c "cd /d %1 && del /s /f /q *.*" - Click OK button to save the setting, and exit from Registry Editor.
For user who doesn’t want to manually edit and mess with the system registry, download empty-folder-contents.zip and apply to merge the empty-folder-contents.reg values to registry.
Now, just right click on the folder and select Empty Folder Contents to delete all its file contents recursively into all sub-directories, but the the sub-folders will not be touched and preserved.
Share and contribute or get technical support and help at My Digital Life Forums.
Related Articles
- Add Take Ownership Option To Files and Folders Context Menu in Vista
- Tips of How to Delete Folder Contents While Maintaining Folder Tree Structure in Windows XP PC
- Delete Files or Folders Locked by Windows Via Unlocker 1.8.7
- Add Notepad2 to Windows Vista or XP Right Click Context Menu
- Delete and Reset Windows Vista Folder Views or Folder Types Settings to Default Clean State
- How to Find and Locate Outlook Personal Folders .PST Files’ Folder Location
- Reveal and Access to Windows Vista Hidden Context-Sensitive (Right Click) Menu Item - Open Command Prompt Here & Copy as Path
- Use Vista SendTo Folder to Add or Delete Send To Menu Items or Shortcuts
- Password Protect Compressed (zipped) Folders and Hence Your Files and Folders
- Show,List Out and Identify All Shared Files and Folders in Windows Vista


























October 7th, 2008 18:25
[...] The empty folder contents trick also works in Windows Vista. [...]
November 24th, 2008 21:39
Wow!
Good stuff, I am using a local folder in my computer where every downloaded file is saved and after a while I just copy these files on my external hard drive and I need to manually delete all the file within this folder.
Now with this menu it’s quite easy and quick!
Thank you guys for the Plus!