Hi,
File.Delete(FilePath,FileName) deletes a file directly from hard-disk, similar as holding Shift and then delete.
I searched but can't find nothing on how to delete to Windows Recycle bin. (For sure I'm not the only one asking this right?)
So I asked GPTchat and it came up with 2 scripts where I'm playing with, but both do not work and are giving errors.
How to correctly delete a File to Windows Recycle bin instead of having it lost immediately forever?
If you want to play with the 2 solutions AI came up with by using shell32, please do so, cause I don't know where the error comes from or how to solve it correctly.
Any other or better solution is welcomed.
Thanks!
File.Delete(FilePath,FileName) deletes a file directly from hard-disk, similar as holding Shift and then delete.
I searched but can't find nothing on how to delete to Windows Recycle bin. (For sure I'm not the only one asking this right?)
So I asked GPTchat and it came up with 2 scripts where I'm playing with, but both do not work and are giving errors.
How to correctly delete a File to Windows Recycle bin instead of having it lost immediately forever?
If you want to play with the 2 solutions AI came up with by using shell32, please do so, cause I don't know where the error comes from or how to solve it correctly.
Any other or better solution is welcomed.
Thanks!