Tech Tips Home
The Best Tech Tips And Daily Deals
Newsletter On The Internet!

WorldStart Tech Tip And Store Search
Email: Password: Login Remember Me

Like what you see here? Subscribe to the Tech Tips newsletter!   Email: Subscribe

Empty Just Folder Contents

Thursday, February 4th, 2010 by | Filed Under: Desktop Enhancement

How many times has something as simple as deleting files wasted your time? Windows file management has progressed much since the old days of MS-DOS, but it’s still far from perfect.

Deleting files is easy in Windows; you just select the folder where the files are stored and press “delete”. But what if you had to delete a whole bunch of files while maintaining the folder structure?

The usual way involves going into each folder, selecting the files and pressing delete. Then you repeat the process for every folder you want to empty of its contents.
This isn’t a problem if you have two or three folders to empty, but if you have a folder structure made up of tens or hundreds of folders, with maybe one or two files in each; it quickly turns into a big time waster.

Luckily there is a solution to this problem. By tweaking the Windows Registry you can add an “Empty folder contents” command to the right-click context menu of your folders.

With one mouse click you could delete all the files in that folder as well as files in any subfolders, while maintaining the folder tree structure.

Warning: Before we go any further, I’d like to point out that messing around with the Windows Registry is not meant for beginners. Editing the Registry directly can have serious, unexpected consequences that can prevent the system from starting and require that you reinstall Windows. If you feel that you do not understand or are unable to perform the steps below, please seek expert advice.

Also, I recommend backing up the Registry before attempting any modification.

To back up the entire Registry in any Windows version, open the Registry editor. Type regedit in the search bar of the start menu, right click on regedit.exe and select Run as administrator. Click on the My Computer (or Computer for Vista and 7) registry key at the top and select File in the top left corner of the window. In the File menu select Export…, give it a name like “registry backup” and choose a safe location to save your file.

If something does go wrong while editing, you can restore the Registry by navigating to where you saved the .reg file and simply double click on it.

Now that you have backed up the Registry you can proceed with the rest of the article.

To change a Registry setting we must first open the Registry Editor. Just follow the same steps above: In Windows XP click Start>Run and type “regedit” then click OK. For Vista and 7, click Start and type “regedit” in the Search Box and pres Enter.


The Registry Editor will now open.

The setting we need to change is located in the Registry structure, at the following address:

Click the plus sign next to HKEY_CLASSES_ROOT and scroll down the list until you locate Directory.

Then click the plus sign next to Directory to reveal shell.

Right click the shell key and from the menu select New and then click on Key.

Type Empty Folder Contents and press Enter from the keyboard.

Right click on Empty Folder Contents and from the menu select New and then click on Key.
Type Command and press Enter from the keyboard.


Left click on the Command key. Locate (Default) at the top of the right window panel and right click on it.

In the menu select Modify and an Edit String dialog box will appear.

Carefully type: cmd /c “cd /d %1 && del /s /f /q *.*” verbatim in the Value Data field and click OK.

Please type the command rather than copying it from above or it may not work.

Now close the Registry Editor by clicking File and then Exit from the menu.


You will see the new Empty Folder Contents command in the right click contextual menu of any folder.

Warning! Clicking the Empty Folder Contents command will delete all the files in the folder and any subfolders without asking for a confirmation. It will also bypass sending the deleted files to the Recycle Bin. Instead it will remove the files directly. Use this command at your own risk.

~Cosmin Ursachi

Leave a Reply

Like these tips? Get them for FREE in your email!

WorldStart's Tech Tips Newsletter

  • Tech Tips Daily - Become a tech pro! Get the very best tech and computer help sent directly to your email every weekday!

  • Tech Tips Weekly - If you don't want our Tech Tips newsletter every day, then sign up for this weekly newsletter to get the best information of the week. Sent on Fridays.

Other Newsletters

  • WorldStart's Daily Deals - Every week, we send out great deals in our Daily Deals newsletter. Many of these deals are exclusively for our Daily Deals newsletter subscribers and can't be found with our regular specials.

  • Just For Grins - Each issue includes a couple clean jokes, some funny quotes, and a hilarious reader's story. Newsletter is sent five days a week.

Enter Email Address:


Your e-mail address is safe with us!
We only use it to send you the newsletters you request. It is NEVER disclosed to a third party for any reason, ever! Plus, if you decided you don't like our newsletters (don't worry, you'll love them), unsubscribing is fast and easy.

Free Newsletter Signup

Tech Tips Daily

Become a tech pro! Get the very best tech and computer help sent directly to your email every weekday!

Tech Tips Weekly

The week's best in tech and computer help. Get your issue sent to your email every Friday!

WorldStart's Daily Deals

The very best deals on the Internet! Get a new set of incredible sales every day of the week!

Just For Grins

Clean jokes, funny quotes, and hilarious comics. Sent 5 times a week straight to your email.


Love Worldstart? Refer A Friend!

WorldStart's Premium Membership

Tip Archive