473,387 Members | 1,603 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,387 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 7204
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.