Page 1 of 1

how to empty recycle bin without prompt?

Posted: 19 May 2011 08:58
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!

Re: how to empty recycle bin without prompt?

Posted: 19 May 2011 09:18
by serendipity
Check "Turn off delete confirmation" from menu Tools | Configuration | File Operations.

Re: how to empty recycle bin without prompt?

Posted: 19 May 2011 09:32
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?

Re: how to empty recycle bin without prompt?

Posted: 19 May 2011 12:44
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.

Re: how to empty recycle bin without prompt?

Posted: 19 May 2011 19:23
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.

Re: how to empty recycle bin without prompt?

Posted: 19 May 2011 19:54
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

Re: how to empty recycle bin without prompt?

Posted: 19 May 2011 20:03
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.

Re: how to empty recycle bin without prompt?

Posted: 29 Jun 2011 20:25
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

Re: how to empty recycle bin without prompt?

Posted: 04 Jul 2011 13:33
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