473,322 Members | 1,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Recycle Bin and Python

How do I move files into the windoze recycle bin from python ?

Regards,

Fuzzy

http://www.voidspace.org.uk/atlantib...thonutils.html
Jul 18 '05 #1
3 7197
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')
-------------------------------------------------------------------
Jul 18 '05 #2
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
Jul 18 '05 #3
Dave Brueck <da**@pythonapocrypha.com> wrote in message news:<ma**************************************@pyt hon.org>...
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/atlantib...thonutils.html
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Chuck Anderson | last post by:
I know this is more of a Windows question, but I've Googled this and can not find an answer. Is there a PHP interface to the Windows recycle bin? I want to put files there instead of deleting...
1
by: Kerem Gümrükcü | last post by:
Hi, how can i get the pyhsical path to a recycle bin object. i am working with the FileSystemWatcher Object and i dont want to handle events inside the recycle bin, because the FSW Object...
1
by: Frank Meng | last post by:
Hi. I wrote a program to get the directory of "Recycle Bin" with SHGetSpecialFolderLocation . It works for "Recent", "SendTo", etc. but it doesn't work for "Recycle Bin". At...
5
by: Gene Vital | last post by:
Can someone point me in the right direction on how to send files to the Recyle Bin using C#.
2
by: John | last post by:
Is the only criteria for worker process recycle 60% physical memory usage?? (I'm on W2K, default setup - I know you can change it in machine.config). Because if so, when using SQL Server on the...
5
by: johnb41 | last post by:
I searched and found a way (via API) t0 add a deleted file to the recycle bin. (Thanks Ken Tucker! :)) But I was wondering if VB.NET 2005 (framework 2.0) has a non-api solution. (Note: i...
10
by: =?Utf-8?B?U3RlZmFuIEJhcmxvdw==?= | last post by:
This has been working perfectly for months. Since we switched from ASP.NET 1.1 to 2.0, we have constant and sporadic issues with updating our applications. Touching the web.config works about...
2
by: Kevin D. Smith | last post by:
I would like to move files and directories to the Recycle Bin on Windows from Python. I have found some older articles describing how to do this, but they require additional packages to be...
2
by: =?Utf-8?B?VVNBT3o=?= | last post by:
I am using Windows Vista Ultimate (x86). I accidently deleted my Desktop Recycle Bin. I restored it (Control Panel/Personalise/Change Desktop Icons). I clicked on the Recycle Bin (Full) icon...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.