user1485528
user1485528

Reputation:

How can I delete a folder or file with path too long in recycle bin?

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:

Upvotes: 6

Views: 1480

Answers (1)

Stefan
Stefan

Reputation: 43575

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

Upvotes: 6

Related Questions