Tuesday, October 7, 2008

Enable 'Empty folder contents' option

This feature helps to 'Empty the folder contents' by keeping the folder tree structure.


1) Go to Start -> Run, then type ‘regedit’ and press enter
2) Locate to HKEY_CLASSES_ROOT\Directory\shell
3) Right click on ‘shell’ folder and choose New -> Key, name the new sub key as ‘Empty Folder Contents’.
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 ‘Default’ as located at right panel. A small Edit String window will be pop up, then enter this value: cmd /c “cd /d %1 && del /s /f /q *.*”
6) Click OK button to save the setting.


Just 'Right Click' the folder you need to empty the contents and you can see the option enabled. All the files in this folder as well as sub folders will be deleted without disturbing the original folder tree structure.

For Windows Vista, do the following...
============================

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


Have Fun :-)

No comments: