views:

44

answers:

2

WinXP, Vista, Win7, there is a certain folder for recyclebin.

How Can I get the recycleBin Path for each disk, for different operation System?

in WinXP it is called XX:\RECYCLER, while in vista it used another name.

Is there any windows C++ API for it ?

Many thanks!

+2  A: 

You can probably use SHGetSpecialFolderLocation(), passing FOLDERID_RecycleBinFolder as the folder type.

API documentation: http://msdn.microsoft.com/en-us/library/bb762203(VS.85).aspx

Full sample in C++: http://justcheckingonall.wordpress.com/2008/05/16/find-shell-folders-win32/

Xavier Poinas
That is a virtual (Shell) folder, not a file system folder. I don't think there is any API to get the file system folder.
Luke
+1  A: 

You can ask a shell namespace object for its SHDESCRIPTIONID and compare with the CLSID of the recycle bin, see this blog post for more info.

Anders