I have the program that deletes and copies some folders or files with long path (when lenght > MAX_PATH) In this program I use the prefix \\?\
that gives me the possibility delete folders or files with long path but only in simple function Delete()
. I need to delete files in Recycle Bin and for this I need use the SHFileOperation
function that gives me possibility delete files in the recycle bin, but this function does not support the prefix \\?\
. Can anybody help me with this issue?
Is there some alternative for SHFileOperation. How can I bypass this problem?
Some links:
- Prefix
\\?\
- Some about Long Path
- SHFileOperation
The recycle bin is a special shell folder. It is part of the shell. The shell however has the limitation that paths must not be longer than MAX_PATH. So the same limitation applies to the recycle bin.
You simply can not put files/folders with long paths in the recycle bin. Not possible.
Edit: Windows 10 has the MAX_PATH limit lifted. See this msdn entry