So here is a tutorial to delete the contents of a folder by retaining the folder structure. This option to ” Empty folder contents” can be added to the right click menu is so easy follow the steps below.
- Go to Start > Run > type regedit.
- Browse to HKEY_CLASSES_ROOT\Directory\shell.
- Right click on shell on the left pane and add a new key and name it as “Empty Folder Contents“.
- Now right click on Empty Folder Contents and create another key(subkey) to it and name it as Command.
- Click on Command and on the right pane you will see a key called default.
- Then double click on it and enter this value cmd /c “cd /d %1 && del /s /f /q *.*” .
- That’s it the job is completed.
- If you have any difficulty in doing it just download this file and run it.
From now onwards you will get the option Empty Folder Contents in Right click menu. So you can delete the folder contents safely and that too without removing folder tree structure.