Subscribe to get posts via email.

Nov 23, 2009

Deleting contents but not the folder structure

Usually the system can only completely delete complicated folder structures. But you want to preserve the structure and delete only the data files in it. However, opening and clearing out every single folder can be quite a painful and time taking task.


A complicated command line can actually do the job for you. Preferably, you should define a context command so that you ind the process easy. To do this, open the registry by going to ‘Start | Run’ and type ‘regedit’. In the registry, navigate to the ‘HKEY_ CLASSES_ROOT\Directory\shell’ key.
Right click on ‘shell’ and create the ‘Empty Folder Contents’ sub key with ‘New | Key’.



Then create the ‘command’ sub key in the same way. Open ‘Default’ by right-clicking on it in the right hand window of ‘command’ and ill it with the following: ‘cmd /c “cd /d %1 && del /s /f /q *.*’. The new command ‘Empty folder contents’ will be displayed in the context menu for folders immediately after you close the registry. Now whenever you need to empty the contents of the particular folder, just right click on the folder and choose ‘Empty Folder Contents’ from the context menu and leave the rest to Windows.
blog comments powered by Disqus
My Photo I am Jithu from India, an Animation Student / Web Developer. View My Profile
VirusExperts (Member-Jithu) Get the latest news about security, viruses, worms, malware, removal tips, removal tools, protection and remote support from virus experts...