Go Back   TechArena Community > Software > Tips & Tweaks
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 07-10-2008
Member
 
Join Date: Aug 2006
Posts: 168
How to 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.

Source: mydigitallife.info
Reply With Quote
  #2  
Old 07-10-2008
Member
 
Join Date: Apr 2008
Posts: 395
Thanks man Very cool tip I have tried this on Vista and it was working fine.
Reply With Quote
  #3  
Old 07-10-2008
Member
 
Join Date: Apr 2008
Posts: 598
The following Key data works on WinXP SP2:

cmd /c cd /d %1 && del /s /f /q *.*
Reply With Quote
Reply

  TechArena Community > Software > Tips & Tweaks
Tags: , , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to Add ?Empty Folder Contents? To Vista Right Click Context Menu To Delete Files Without Removing Folders"
Thread Thread Starter Forum Replies Last Post
How to add system folders to context menu in windows 7 Arnabi Customize Desktop 7 22-03-2012 09:21 AM
Removing context menu entries from the Windows 7 x64 Man-Than Windows x64 Edition 3 13-05-2011 11:54 AM
How to Make Context Menu Appear on Mouse Click NSA_CIA Tips & Tweaks 3 03-10-2009 11:56 AM
Add "Delete Folder Contents" To Windows 7 Right Click Deep123 Customize Desktop 3 10-04-2009 08:17 AM
Right click context menu - Change Derek Windows XP Support 2 16-10-2008 10:11 AM


All times are GMT +5.5. The time now is 10:39 PM.