how to empty recycle bin without prompt?

Discuss and share scripts and script files...
Post Reply
Huidong
Posts: 213
Joined: 18 May 2011 21:55

how to empty recycle bin without prompt?

Post by Huidong »

I know there's a specific built-in script to empty the recycle bin, but when I decide to empty it, I mean it (I've checked what's in it), hence it's nearly useless at least to me to confirm it. So I wonder if there's a way to make a script so that I can empty it without a prompt window? Thanks!

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: how to empty recycle bin without prompt?

Post by serendipity »

Check "Turn off delete confirmation" from menu Tools | Configuration | File Operations.

Huidong
Posts: 213
Joined: 18 May 2011 21:55

Re: how to empty recycle bin without prompt?

Post by Huidong »

That works. Thank you. But I'm wondering if it's possible to automatically deal with the prompt (choose yes) only for the empty recycle bin command, instead of globally turning off all prompts?

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: how to empty recycle bin without prompt?

Post by serendipity »

Huidong wrote:That works. Thank you. But I'm wondering if it's possible to automatically deal with the prompt (choose yes) only for the empty recycle bin command, instead of globally turning off all prompts?
I was hoping this script will do it:

Code: Select all

delete 0,0, "%recycler%\*";
but for some reason XY does not let me do it.

An ugly workaround is to go to recycle bin and select all items and delete them.

Code: Select all

//Recycle bin no prompt
   tab("new", "%recycler%"); //Go to recycle bin in new tab
   sel a;                            //Select all items
   delete 0, 0, ":list";           //Delete all items, no recycle bin (well beats the purpose), no prompt
   #351;                           // Close tab
WARNING: use caution with command "delete 0,0, ...". It does not ask for confirmation nor does it use recycle bin.

Huidong
Posts: 213
Joined: 18 May 2011 21:55

Re: how to empty recycle bin without prompt?

Post by Huidong »

That's perfectly working and truly educational! Since I have the recycler tab always open, locked, and iconized, I'll use goto instead of tab to better fit my situation:

Code: Select all

"Empty Recycle Bin without prompt"
  goto "%recycler%", 1; sel a; delete 0, 0, ":list"; #520; //Go back
"_Empty Recycle Bin"
  #642;
Best regards.

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: how to empty recycle bin without prompt?

Post by serendipity »

Huidong wrote:That's perfectly working and truly educational! Since I have the recycler tab always open, locked, and iconized, I'll use goto instead of tab to better fit my situation:

Code: Select all

"Empty Recycle Bin without prompt"
  goto "%recycler%", 1; sel a; delete 0, 0, ":list"; #520; //Go back
"_Empty Recycle Bin"
  #642;
Best regards.
Wow! You are a fast learner. Happy scripting. :D

Huidong
Posts: 213
Joined: 18 May 2011 21:55

Re: how to empty recycle bin without prompt?

Post by Huidong »

So happy... XY should be used as a programming startup, because we get most motivated when the codes immediately serve us well. Thanks again, serendipity.

unrealreality
Posts: 16
Joined: 29 Jul 2010 19:54
Contact:

Re: how to empty recycle bin without prompt?

Post by unrealreality »

Hello,

Here's another way to empty the recycle bin with one click. Download a small command prompt program from http://www.nirsoft.net called "NirCmd" What I did was create a new catalog entry and called it "empty Recycle Bin" and then for the application string I used:

Code: Select all

"..\NirSoft\NirCmd\nircmd.exe" emptybin
and for action on click i chose: "Open selected list item with application"

By doing this, one click empties the recycle bin in one shot. I'm guessing you could also create a user button to do the same thing (with pretty icon).

The nircmd is also pretty cool as I have shortcuts to mute/unmute my audio, and open/close my CD tray with one click. Pretty cool stuff.

E

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: how to empty recycle bin without prompt?

Post by aurumdigitus »

Thanks for the information about "NirCmd". Hadn't run into it previously. With in minutes created a CTB to implement several of its clever little functions! :D

Post Reply