Recycle Bin and Python

Discussion in 'Python' started by Michael Foord, Oct 15, 2004.

  1. Michael Foord, Oct 15, 2004
    #1
    1. Advertising

  2. Michael Foord

    Peter Maas Guest

    Michael Foord schrieb:
    > How do I move files into the windoze recycle bin from python ?


    By moving them into the recycle directory?

    --
    -------------------------------------------------------------------
    Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
    E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
    -------------------------------------------------------------------
    Peter Maas, Oct 15, 2004
    #2
    1. Advertising

  3. Michael Foord

    Dave Brueck Guest

    Michael Foord wrote:
    > How do I move files into the windoze recycle bin from python ?


    This is really a Windows API question first, and a Python question second.

    1) Find out the "official" way to do this in Windows

    I googled for "msdn move file recycle bin" and the first link that came back was
    a page on MSDN for SHFileOperation. In typical Windows fashion, it involves
    populating some structure and passing it to the function, but it does appear to
    do the trick.

    2) Figure out how to do this in Python.

    You can create such a structure in ctypes, after which you can make the actual
    call like this:

    i = windll.shell32.SHFileOperationA(byref(yourStruct))

    HTH,
    Dave
    Dave Brueck, Oct 15, 2004
    #3
  4. Dave Brueck <> wrote in message news:<>...
    > Michael Foord wrote:
    > > How do I move files into the windoze recycle bin from python ?

    >
    > This is really a Windows API question first, and a Python question second.
    >
    > 1) Find out the "official" way to do this in Windows
    >
    > I googled for "msdn move file recycle bin" and the first link that came back was
    > a page on MSDN for SHFileOperation. In typical Windows fashion, it involves
    > populating some structure and passing it to the function, but it does appear to
    > do the trick.
    >
    > 2) Figure out how to do this in Python.
    >
    > You can create such a structure in ctypes, after which you can make the actual
    > call like this:
    >
    > i = windll.shell32.SHFileOperationA(byref(yourStruct))
    >
    > HTH,
    > Dave



    It does help.. yeeurgh....

    But thanks.

    Fuzzy

    http://www.voidspace.org.uk/atlantibots/pythonutils.html
    Michael Foord, Oct 15, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. raghav

    app_offline in recycle bin

    raghav, Sep 28, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    424
    raghav
    Sep 28, 2006
  2. Roedy Green

    Empty recycle bin

    Roedy Green, May 30, 2007, in forum: Java
    Replies:
    3
    Views:
    674
  3. Kevin D. Smith
    Replies:
    7
    Views:
    927
    Chris Mellon
    Aug 16, 2007
  4. Barry L. Camp

    Gridview as Recycle Bin

    Barry L. Camp, Mar 3, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    286
    Barry L. Camp
    Mar 3, 2008
  5. anne001
    Replies:
    1
    Views:
    400
Loading...

Share This Page