Accessing Recycle Bin Folder Path and Files in it

Hi

I want to find the path of Recycle Bin Folder and original path of files and
folders that are in recycle bin.
or complete path of files and folders with recycle bin.


Please reply
Thanks
davinder101Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mahesh1402Commented:
You need SHGetSpecialFolderLocation()  to access path of Recycle Bin Folder.

http://www.codeproject.com/shell/recyclebin.asp <==== This is similar what you are looking for


MAHESH
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
davinder101Author Commented:
HI
Here Now I am able to find the files and folders in Recycle Bin Folder, now problem is that I want to delete these files and folders from Recycle Bin,
For this either I should have the handle of files in Recycle Bin,

so Please guide me the way to access files of the Recycle Bin Folder

Please help me.
Thanks
0
mahesh1402Commented:
davinder101 ,

 There is all in above project. Have a look at FillFolder()/  FillFolder2() functions. ABout deleting items from recyclebin when you right click on file list in above sample it gives you option to delete file from recyclebin. Have also look at SHEmptyRecycleBin() function.

I will suggest you to go thru full source code of above example.

MAHESH
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

mahesh1402Commented:
Otherwise you may also refer function UnDelete() from above sample project.. You can Un Delete file to restore it and you may then use DeleteFile() API to permanently delete file.

MAHESH
0
davinder101Author Commented:
Thanks MAHESH
Actually I through the source code of given link,
Infact what I need is to first overwrite the files which are present in Recycle Bin and then delete the file .
So the idea of SHEmptyRecycleBin() or from the source code of above sample does not fulfill my requirement.

So please tell me that how to overwrite the files that are in RECYCLE BIN.

Please Help.
Thanks
0
mahesh1402Commented:
>>So please tell me that how to overwrite the files that are in RECYCLE BIN.

Create Dummy files at  same path location and move them to recycle bin. Use function SHFileOperation() to send file to recycle bin.

MAHESH
0
davinder101Author Commented:
Thanks mahesh1402
As you guided I worked and now able to restore files from recycle bin to  its original location,
but now having one problem which is as follows:
Let we have files of size 700 MB in Recycle Bin Folder and its original location is D:\, now in D: there is only 200 MB free space, so what will happen if we are trying to restore such files,
also guide me to handle this problem.

Thanks
0
mahesh1402Commented:
davinder,
 If we dont have enough space and when we try to move files to recycle bin folder Windows Warn us that files will be permanently deleted instead of moving them to Recycle Bin folder.

MAHESH
0
davinder101Author Commented:
HI Mahesh
Actually I asked restoring of files from recycle bin to its original location.( not from original location to recycle bin)
so please tell me what will happen when restoring from recycle bin and if at original location there is not enoug space for the file.

Please reply.
Thanks

0
mahesh1402Commented:
Well, I guess offcourse "There is not enough space on the disk" warning.... Because while restoring files You should have enough disk space to store restored files from recyclebin . So its good to check for enough disk space programatically and generate your own proper warning to alert user so that he will manually delete unwanted data from disk.

MAHESH
0
mahesh1402Commented:
So davinder its helped ?

MAHESH
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.