in reply to Re: Command To Empty Recycle Bin With Perl?
in thread Command To Empty Recycle Bin With Perl?

Hi Simon,

I'm actually using  system "wzzip -m ..." Nothing has changed on my PC besides the version of Perl, which was an upgrade from 5.6.1 to 5.16.1; I'm using the same PC and same version of WinZip, and no other applications on the PC have changed. Having the result of this upgrade change a permanent delete to a move to Recycle Bin was definitely unexpected. I don't want to disable the Recycle Bin because it needs to be available for other purposes, so any other suggestions?

Thanks!

Replies are listed 'Best First'.
Re^3: Command To Empty Recycle Bin With Perl?
by SimonPratt (Friar) on Jul 14, 2014 at 08:22 UTC

    Hi, Sphinxy09

    I stand by what I said earlier - Perl does not interact with the recycle bin in this fashion (indeed, I am sceptical that any application could legitimately hijack the delete function in Windows like this). The method you are using to run WinZip is basically the same as you opening a command prompt and typing wzzip -m .... If you try this now, WinZip should exhibit exactly the same behaviour as when Perl calls it.

    As for a fix, you can go with either Athanasius' suggestion, or with bulk88's code (though I would suggest changing line 13 to my  $return = SHEmptyRecycleBin(0, "", 1); once you are certain it is doing what you want (the 1 tells Windows to run the command without prompting for confirmation)