Send a File to the Recycle Bin
being the obvious search result. I've tried the wrapper provided, but it has errors when brought into Unity, IntPtr doesn't compile for starters. I've also imported Microsoft.VisualBasic
and it's dependant System.Deployment
into my project and am successfully calling
Debug.Log(Microsoft.VisualBasic.FileIO.FileSystem.FileExists(path + "\\test.txt"));
Microsoft.VisualBasic.FileIO.FileSystem.DeleteFile(path + "\\test.txt", UIOption.OnlyErrorDialogs, RecycleOption.SendToRecycleBin);
but it just delete the file, it does not go to the recycle bin. Unity is running on the C drive, the project is also on the C drive. I've tried files and folders, and have tried RecycleOption.DeletePermanently
, it does recognize the files and folders with the Debug, but nothing ever shows up in the recycle bin.