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:

  1. Run Registry Editor (regedit).
  2. Navigate to the following registry key:

    HKEY_CLASSES_ROOT\Directory\shell

  3. Right click on shell folder, and then choose New -> Key. Name the new subkey as Empty Folder Contents, or anything you would like.
  4. Right click on Empty Folder Contents and choose New -> Key. Name the sub-key as Command.
  5. Under the Command sub-key, double click on the Default value data that is located at right pane.
  6. On the pop-up “Edit String” dialog window, enter the following value:

    cmd /c "cd /d %1 && del /s /f /q *.*"

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



2 Responses to “Add “Empty Folder Contents” To Vista Right Click Context Menu To Delete Files Without Removing Folders”

  1. Tips of How to Delete Folder Contents While Maintaining Folder Tree Structure in Windows XP PC » My Digital Life
    October 7th, 2008 18:25
    1

    [...] The empty folder contents trick also works in Windows Vista. [...]

  2. Douglas Mutay
    November 24th, 2008 21:39
    2

    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!

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. To receive notification of latest comments posted, subscribe to My Digital Life Comments RSS feed or register to receive new comments in daily email digest.
Custom Search

New Articles

Incoming Search Terms for the Article

empty folder content - Vista Folder Context menu - find empty folders - edit context menu vista - search for empty folders - all - remove share context vista - edit "right click folder" - Merge PST files for vista download from rapidshare - create blank folder name in vista - adding right click options to files in vista - deleting vista searches folder contents - delete folder in vista - empty folders in vista mail - how to delete folder in vista in cmd - how to delete on start menu vista - vista name folders - vista empty dirs del - win xp folder right click menu edit - windows right click content menu folder sub folder - adding files to right click options - add application to right click menu vista - add downloads folder to vista start menu - cannot delete empty folder vista - can't search folder contents in vista - context menu command vista - delete right click vista - empty folder contents - find empty folders vista - remove right click menu vista - right click empty - right click folder contents - vista right click menu - vista add new features empty - vista find empty folders - vista right click editor - vista right click remove new - vista context menu - "context menu registry key download" - add search function to vista right click - add program to "right click menu" vista - all the files inside the folder deleted and the folder shows empty - can't find add on folder for wow on vista - content menu windows - copy contents from sub folder + windows - del folder vista - delete empty folders in vista - edit right click menu in vista - email an empty folder structure - how to remove empty folders -