Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Command To Empty Recycle Bin With Perl?

by SimonPratt (Friar)
on Jul 14, 2014 at 08:22 UTC ( [id://1093511]=note: print w/replies, xml ) Need Help??


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

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)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1093511]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-03-28 08:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found