WinNT: Delete to recycle bin?

D-Man dsh8290 at
Thu Jun 28 21:55:26 CEST 2001

On Thu, Jun 28, 2001 at 03:15:47PM -0400, John Hoerr wrote:
| hi!
| i'm relatively new to python and am wondering if there's a way to remove
| files to the windows recycle bin instead of deleting them outright.

First, I have never tried to do that, nor do I know how it is done.

Now my incliniation is that in the Win32 API there is some sort of
"delete" function that (maybe) provides the "Are you sure" dialog (I'm
thinking of using explorer here) and does the necessary bookkeeping to
remove it from the filesystem and add it to the recycle bin.  I
suggest looking through the win32all extensions and see if you find
anything there.  Also check other Windows devel sites and see if you
can find what the underlying (C++?) API is.  I don't think that
os.system( "del foo" ) does what you want ;-).


More information about the Python-list mailing list