Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is There a Winapi way to Move a File to The Recycling Bin?

I've looking into a lot of different methods, but most of them require adding a file to System32, while I'm looking for a line that would allow you to move something to the recycle bin without anything being added to a computer, because I want something that would work on all Windows computers immediately. Rest assured that the deletion will not delete any major files and will ask for confirmation. I am thinking of using system("") in C++ to run the line.

like image 812
Eric Avatar asked Apr 08 '11 21:04

Eric


People also ask

Why can't I move files to the Recycle Bin?

On your desktop, right-click the Recycle Bin icon and then click Properties. When the Recycle Bin dialog box pops up, ensure that the radio button under Settings for selected location is on Custom size and not on Don't move files to the Recycle Bin. Confirm this action by clicking Apply. Click OK to close the window.

Does putting a file in the recycling bin delete it?

Generally, a file or folder would be stored in the Recycle Bin after they are deleted. Only clicking the key combination "Shift + Delete" could delete them directly. However, during the use, clicking delete button would directly delete files if the Recycle Bin's settings changed.


1 Answers

See SHFileOperation with FOF_ALLOWUNDO.

like image 142
user541686 Avatar answered Sep 21 '22 02:09

user541686