Using SHFileOperation

Discussion in 'Python' started by avishay, Jul 20, 2005.

  1. avishay

    avishay Guest

    Hi All,
    I want to use SHFileOperation using Python and Win32 extentions, in
    order to move a file to the trash can. The function itself can be
    accessed by importing win32com.shell.shell. However, I cannot find
    anywhere the SHFILEOPSTRUCT. This structure is mentioned in the
    documentation of the Win32 extentions, but I can't find a way to access
    it.
    I would appreciate your help. If there's an alternative way to send a
    file to the trash can, that can also help.

    Best Regards
    Avishay
     
    avishay, Jul 20, 2005
    #1
    1. Advertising

  2. avishay

    Roger Upole Guest

    SHFILEOPSTRUCT is just a tuple, with the elements
    listed in docs.

    from win32com.shell import shell, shellcon
    shell.SHFileOperation((0, shellcon.FO_DELETE, 'somefilename', None, shellcon.FOF_ALLOWUNDO|shellcon.FOF_NOCONFIRMATION))

    hth
    Roger

    "avishay" <> wrote in message news:...
    > Hi All,
    > I want to use SHFileOperation using Python and Win32 extentions, in
    > order to move a file to the trash can. The function itself can be
    > accessed by importing win32com.shell.shell. However, I cannot find
    > anywhere the SHFILEOPSTRUCT. This structure is mentioned in the
    > documentation of the Win32 extentions, but I can't find a way to access
    > it.
    > I would appreciate your help. If there's an alternative way to send a
    > file to the trash can, that can also help.
    >
    > Best Regards
    > Avishay
    >




    ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
    ----= East and West-Coast Server Farms - Total Privacy via Encryption =----
     
    Roger Upole, Jul 20, 2005
    #2
    1. Advertising

  3. avishay

    avishay Guest

    Thanks.
     
    avishay, Jul 21, 2005
    #3
    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. William F. Robertson, Jr.
    Replies:
    1
    Views:
    988
    Kathy Burke
    Jun 25, 2003
  2. pete
    Replies:
    1
    Views:
    2,977
    Jon Yates
    Aug 29, 2003
  3. timmso
    Replies:
    1
    Views:
    533
    Alex Papadimoulis
    Dec 12, 2003
  4. Replies:
    2
    Views:
    562
  5. David S.

    SHFileOperation Help

    David S., Apr 4, 2006, in forum: C++
    Replies:
    1
    Views:
    405
    mlimber
    Apr 4, 2006
Loading...

Share This Page