Making a 'empty-able' folder

You know how the Recycle Bin is emptiable right? How could I make a regular folder like that?

I have a folder on my desktop called "Downloads". FireFox downloads everything into that folder. When I want to clear out all my old downloaded files, I have to get in there and do it manually.

What I am looking for is a way to 'Right Click > Empty' the folder.

Is this possible? And if yes, how?

#472204

The closest I can get you is this. You need to change the folder name in the array to point to your download folder most likely "C:Documents and Settings[Your Name]DesktopDownloads".

Then place the script in your SendTo folder. When you want to run it, then just right click on the folder, go to SendTo Menu and choose the script.

Delete_All_Files_In_Folder.zip

Attachment: Delete_All_Files_In_Folder.zip

#472212

Probably easier to create a batch file that deletes that folder, then re-creates it.

#472213

or or or, you could go in the folder, select all the files, than press delete...

#472214

Here's a script that does the same as what Viper's batch file would do. Copy/paste into notepad and save with a .vbs extension.

Set objFSO = CreateObject("Scripting.FileSystemObject")

strPath="C:MyDownloads"

objFSO.DeleteFolder(strPath)

Call SmartCreateFolder(strPath)



Sub SmartCreateFolder(strPath)

If objFSO.FolderExists(strPath) Then

Exit Sub

Else

SmartCreateFolder(objFSO.GetParentFolderName(strPath))

End If

objFSO.CreateFolder(strPath)



End Sub

Set objFSO = Nothing

#472215

lol yes, coldwerturkey, that is what I meant by doing it manually ;). I would like to have this because sometimes I have countless windows open and its easier to do so as said.

Thanks, SirSmiley, I will try it out and post my results :).

EDIT: SirSmiley, the second post you gave me did not work... I am still working on trying the first one, but I have a bit of a n00bish question; how do I put this file into my SendTo folder?

EDIT 2: Also; when double-clicked (your first post), it works; it deletes all the files, but it does not delete the folders that are inside, just individual files.

#472216

Wasn't sure the second one would work for everyone. To answer your second question I only made the script for files not subfolders and it's not recursive.

I'll have a look later. In the middle of a violent T-storm.

#472217

ohmigosh, I am too :P.

Okay, take your time, no rush ;).

#472219

Here's the one with recursion. It's messy code but, should work.

Delete_Recursively.zip

Attachment: Delete_Recursively.zip

#472269

woot! It worked like a charm! Thanks so much SirSmiley! :D

Just one thing, can someone tell me how to add it to the "Send To" menu?

#472273

Move it or create a shortcut in this folder

C:Documents and Settings[Your Name]SendTo

#472277

*doh*

shoulda known that, once again,

You Rock!

#472278

Wow, this sounds very handy, thanks. :)

*bookmarks page and makes a mental note to try later*

#472294

Thanks guys. :D

Here's one that will work on any folder that you right click the Sendto Menu with. Should be very careful with this one in particular.

Note: These scripts permanently delete the files.

Delete_Recursively_4_SendTo.zip

Attachment: Delete_Recursively_4_SendTo.zip

#472300

This is very handy , thanks SirSmiley

#472778

what about for mac?

#472813

what about for mac?

Write an AppleScript, an Automator app, or a shell script.

-NC

#473768

I've found a way to put this or any script for that matter into your context menu or a submenu using Fast Explorer 2007. I'm sure this could be done with a registry hack.

The only issue again is the permanent deletion but, I'm looking into how to delete to the recycle bin.

Maybe I'll put a tutorial up at instructables if the interest is there?

Regular Context Menu:

contextnt7.jpg

Custom SubMenu:

contextsubmenulm1.jpg

#474007

yeeeees, that is spectacular :). Tutorial would be superior :D.

#474012

I'll work on a tutorial for this week.

Until then here's a script that will delete files & subfolders to the recycle bin instead of permanently. It is slightly slower.

Delete_to_Recycle_Bin_Recursively.zip

Attachment: Delete_to_Recycle_Bin_Recursively.zip

#474017

Thats even better!

Works with Vista too, no doubt?

:D

EDIT:

nope, didn't work for me in Vista.

#474019

I've found a way to put this or any script for that matter into your context menu or a submenu using Fast Explorer 2007. I'm sure this could be done with a registry hack.

This would be really cool (very interested)

#474026

Thats even better!

nope, didn't work for me in Vista.

Most likely not because it uses the Shell.Application and of course Vista is a different shell than XP. ;)

Gunter Born has an activeX but, it uses the same method so doubt it would work on Vista either. Maybe powershell?

#474027

Anything that will work in Vista is fine with me :).

#474028