Ken - No, the user doesn't have permission. As described by me in one or other post, it is necessary to go through the UAC business. That souldn't affect anything.
I'm not sure about "the inability to restore the file might dictate whether the file goes into the recycle bin or not" - why would that be so? And can it be averted? But - relating to the SHFileOperation test code in C#, not the use of Microsoft.VisualBasic assembly in either Vb.NET and C#, because I have tried both ways - I have just this minute found at SO <http://stackoverflow.com/questions/2342628/deleting-file-to-recycle-bin-on- windows-x64-in-c-sharp/2342776#2342776> that for 64-bit Windows 7, it is necessary to omit the Pack=1 in this struct - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 1)] - else it fails. I'm on Win7, 64-bit but compiling for x86 but I am not sure if that would avert the problem that is described at StackOverflow. That article at SO is not really helpful to me, as it doesn't tell if any respondents are deleting from the root directory. It's rather confusing to me. Also, (off track) I can't see the need for FileSystemProxy class when there is a FileSystem class (both in Microsoft.VisualBasic) - but I will chase that up another day. _____ Ian Thomas Victoria Park, Western Australia From: [email protected] [mailto:[email protected]] On Behalf Of Ken Schaefer Sent: Friday, October 18, 2013 1:25 PM To: ozDotNet Subject: RE: Problem with FileSystem.DeleteFile method in root directory Does the user actually have permission to restore the item to the root of c:\? I tested on my Win8 machine, and the user is prompted with a UAC prompt. Maybe the inability to restore the file might dictate whether the file goes into the recycle bin or not? Cheers Ken
