Using SHFileOperation

A

avishay

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
 
R

Roger Upole

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top