Tuesday, October 25, 2011

Deleting folder contents without deleting the folder

Some people feels irritating by deleting all the folders and creating New folders with the same name and adding different contents, makes them time consuming. So why can't we delete the contents alone but not the folder which remains the same, yes there is an option.

Follow these simple steps to add a context menu entry.

1] Open Start Menu > Run > type regedit.exe and hit enter.

2] In the Registry Editor navigate to the path

    HKEY_CLASSES_ROOT\Directory\Shell

3] In the left pane, Right click on the Shell folder > select New > Key, name the key as Delete Folder Contents.

4] Now Right click on the Delete Folder Contents > select New > Key and name the key as command.

5] In the right pane, Right click the default string value > Modify.

6] Now type (or) copy/paste the exact command below.

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



7] Click OK and close the Registry Editor.
 
Now whenever you want to delete the folder contents but not the folder, just right click on the folder which you want to delete and select Delete Folder Contents.

No comments:

Post a Comment

Feel free to comment...

Livefyre