Ian, years ago I remember seeing a Q&A about how to NOT send things into
the recycle bin, and I vaguely recall it required a Win32 API call probably
in shell32. If you can find that call and reverse the flag it might do what
you want.

Wait, it might be
http://msdn.microsoft.com/en-us/library/windows/desktop/bb762164(v=vs.85).aspx,
but I'm not certain.

Greg


On 17 October 2013 20:16, Ian Thomas <il.tho...@iinet.net.au> wrote:

> This is situation is for a standard user on Windows 7. There is no such
> problem on pre-Vista Windows versions – and I assume the Windows 8
> behaviour is similar to that on Windows 7.****
>
> I want to use the Microsoft.VisualBasic assembly’s FileSystem.Delete
> method universally, but can’t work out how to get around the problem that
> the RecycleOption.SendToRecycleBin parameter is overridden once permission
> is given by the user to delete the file, when that file is in a restricted
> location like the root directory. ****
>
> ** **
>
> My.Computer.FileSystem.DeleteFile(TestFilePath,****
>
>                                   FileIO.UIOption.AllDialogs,****
>
>                                   FileIO.RecycleOption.SendToRecycleBin,**
> **
>
>                                   FileIO.UICancelOption.ThrowException)***
> *
>
> If TestFilePath is “C:\test.file” then the usual security dialog occurs,
> and on continuing & giving permission the file is deleted – but
> permanently. ****
>
> On the otherhand, in a location like the user’s desktop****
>
>      (Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & 
> "\Test.txt")****
>
> it *does* get deleted to the recycle bin. ****
>
> How can I have the files always go to the recycle bin (assuming the user
> gives permission, as required)? ****
> ------------------------------
>
> **Ian Thomas**
> Victoria Park, ****Western Australia********
>

Reply via email to