Go to Github

Move files and folders to the Windows recycle bin to Github

FundedView inUse the newer IFileOperation interface#1

sindresorhuscreated this issue 13 days ago

From the SHFileOperation docs:

This function has been replaced in Windows Vista by IFileOperation.


I wanted to use IFileOperation initially, but couldn't find any good examples of using it in C. Most used it in C++.

Should use the IFileOperation::DeleteItems and IFileOperation::SetOperationFlags(FOFX_ADDUNDORECORD | FOFX_RECYCLEONDELETE | FOF_NOERRORUI | FOF_SILENT | FOFX_EARLYFAILURE) methods.


Switching to then newer API might add support for long paths, not really sure. See:


We can still keep the SHFileOperation around for support for Vista and older, as the FOFX_RECYCLEONDELETE flag requires Windows 8.


Help wanted - My C skills are very much at a noobish level, so any help would be much appriciated :)

Happy to use C++ if that's what it takes. I'm just trying to keep it simple with C.


Amount funded


Resolve this issue and earn $90.00

Fund this issue

Fund as

Payment method


Please sign in first to fund this issue

Sign in with

Pull requests



    URL of your pull request

    Submit your pull request

    Please sign in first to submit a pull request

    Sign in with