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开发者_C百科 not delete any major files and will ask for confirmation. I am thinking of using system("") in C++ to run the line.
See SHFileOperation with FOF_ALLOWUNDO
.
There are a number of Recycle-Bin commandline tools mentioned here on alt.comp[1] (It even includes a fully automatic daemon that translates any file delete into 'move-to-recycle-bin')
The most popular seems to be Recycle from CmdUtils by Maddog, which is free and open source (GPL).
[1] Command line delete to recycle bin?
精彩评论