loading
This originally developed out of a thread over at Aqua-soft.org about
Creating an "Empty-able" Folder. Making an "Empty-able" Folder

Someone wanted to be able to empty the contents of a their download folder without
deleting the folder. Before jumping to the obvious delete & create a new folder
suggestion there are a number of reasons someone would want this done this way.

The main reason is if you have scripts or multiple apps that reference that particular folder than
you would need to make sure everything was closed before using the standard
window features depending on each programs needs.

So, I hacked together a number of scripts to be used from the Sendto menu but, was
looking into a more direct option. Enter Fast Explorer, which had been sitting around
on my drive waiting for a try.

What you'll need.

Fast Explorer 2007 (Freeware)
http://thesoftpro.tripod.com/downloads/fe/index.htm

Microsoft Script Host
http://www.microsoft.com/downloads/results.aspx?pocId=&freetext=Windows%20Script%20Host&DisplayLang=en

Administrative Level Access to your computer
(this is an assumption as I haven't tried it under a limited account)

The two scripts attached at the end of this instructable:
Empty_Folder.vbs
Delete_to_Recycle_Bin.vbs*

*Note: This script doesn't work on Vista

Step 1: Add Item to the Folder Context Menu

These are the steps to follow in order to run a script from any folder context menu.

1. Start Fast Explorer
2. Select the Static Items Tab
3. Under Menu Items Choose Add
4. Under Item Details section select the browse button beside the Application box
5. Browse to your Windows\System32 folder and select wscript.exe (this is the script host)
6. Next Select the Parameters text box and type in the path to the script file as follows:
"C:\MyFolder\Empty_Folder.vbs" "%1"
(*Note if the above parameter doesn't work then try a dos path to the file or "%I")
7. In Item Details section, next Select the drop down box beside File Type and select Folder.
8. Now go back to the Menu Items Section and right click on the Item
9. Choose Rename and enter the name you want.
10. Select apply. (Bottom right corner)

*Don't choose okay since we will be using Fast Explorer again.

Open explorer and right click on a folder and your new item should be visible in the
context menu.

Step 2: Create a Submenu and Add an Item

This will demonstrate how to create a folder context menu submenu and add an item to it.

Continuing on from before or open Fast Explorer if you happened to close it.
1. Select the Submenu Items Tab
2. Under Menu Items Section Select Item Button
3. Choose Add Submenu from the drop down menu
4. Right click on the new menu and choose rename Your Menu
5. Under Item Details Section choose the Folder from the File Type drop down box
(this will make sure the item shows on folder right click menu only)
6. Under Menu Items Section Select Item Button
7. Choose Add Add Item from the drop down menu
8. Under Item Details Section choose the browse button beside Application and Browse to Wscript.exe
9. Type Parameters:
"C:\Mgmt\scripts\Context\DELETE~1.VBS" %1
10. Choose File Type: Folder (If not already chosen)
11. Under Menu Items Section Right click the item or hit F2 then rename Item
12. Choose Apply (Bottom Right Corner)

Browse to a folder in explorer and right click
There should be a new item Called My Folder Tools
Click on this should display your submenu.

Step 3: Files & Assorted Notes

Warning: The first script permanently deletes files and both scripts delete the entire contents of the chosen folder

This has been tested on Windows XP but, may Fast Explorer is suppose to be Vista Compatible.

Empty_Folder.vbs
- This script uses the FileSystemObject and bypasses the recycle bin.
- The fastest script

Delete_to_Recycle_Bin.vbs
- This script uses the Invoke Verb method to move items
- It calls the Shell.Application which I believe is part of the reason it won't run on vista
- noticeably slower
nifty, but i don't see the problem with pressing "ctrl+a", then either "delete" or "shift+delete" so i don't have to move my hands off the keyboard. if i'm going to do two mouse clicks and a mouse movement, i can do two keyboard commands.
yes, I'm a big keyboard fan too but, if we're splitting hairs it will take more than two keyboard commands. select folder, enter, than the two key board commands. As opposed to open explorer select folder & right click, select command. Or for faster results put an "&" sign in front of one of the letters and you've got a quicker way to select the item plus eliminated one mouse movement/click. Or you could script it in AutoHotkey and kick both methods to the curb. ;) I picked a simple script to demonstrate with but, you could attach any kind of script. Such as sort contents into folders based on date which would create the folders, etc. That's where the power is.

About This Instructable

5,027views

6favorites

License:

More by SirSmiley:Running Scripts Directly from the Context Menu in Windows XP 
Add instructable to: