windows explorer and recycle bin

Hi all,

When I hit the Delete key on a local drive, Windows Explorer interprets that
as moving the file to the Recycle Bin. Permanent deletion requires
Shift-Delete.

On a network drive, on the other hand, Delete is permanent deletion.

My question: how does Windows Explorer decide which behavior the Delete key
should map to? Is it based on GetDriveType == DRIVE_FIXED vs. DRIVE_REMOTE,
and thus on whether my file system declares itself to be a
FILE_DEVICE_DISK_FILE_SYSTEM or some other type of _FILE_SYSTEM? Or is it
based on something else (not sure what)?

My intent here is to stop Windows Explorer from trying to implement Recycle
Bin behavior for my file system driver – there’s really no sense in having
this in my particular file system, given that the user can easily “undelete”
a file in other ways, without needing to keep an extra copy around in some
magic folder (whose existence causes other problems).

Thanks,


Matt Craighead
Founder/CEO, Conifer Systems LLC
http://www.conifersystems.com
512-772-1834

>My intent here is to stop Windows Explorer from trying to implement >Recycle Bin behavior for my file system driver – there’s really no sense >in having this in my particular file system, given that the user can >easily “undelete” a file in other ways, without needing to keep an extra >copy around in some magic folder (whose existence causes other problems).

If I remember correctly, there is a registry setting using which you can turn on/off recycle bin.
I think it is:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\NukeOnDelete

Regards,
Ayush Gupta

Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/

You can disable the recycle bin on a per drive basis. Right click ‘Recyle
Bin’ and choose ‘Properties’. You can set it under Global for all drives or
by choosing the per drive choice you can disable the recycle bin on each
drive as you desire. You can control how much space will be allocated for
the recycle bins.

“Ayush Gupta” wrote in message news:xxxxx@ntfsd…
>My intent here is to stop Windows Explorer from trying to implement
> >Recycle Bin behavior for my file system driver – there’s really no sense
> >in having this in my particular file system, given that the user can
> >easily “undelete” a file in other ways, without needing to keep an extra
> >copy around in some magic folder (whose existence causes other problems).

If I remember correctly, there is a registry setting using which you can
turn on/off recycle bin.
I think it is:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\NukeOnDelete

Regards,
Ayush Gupta

Add more friends to your messenger and enjoy! Go to
http://messenger.yahoo.com/invite/

Both of these sound like things that individual users might do, but it
doesn’t sound appropriate for my software’s installer to directly mess with
these kinds of registry keys.

Ideally I’m looking for something I can change inside the FSD itself that
will convince Explorer that it’s inappropriate to have Recycle Bin for this
drive, just like it already knows for network drives – and something
automatic “out of the box”, without the user having to do anything.

And ideally I can stay a DISK_FILE_SYSTEM; being a network file system or
some other class causes a lot of apps to change their behavior in other
ways. For example running .NET applications off a “network” file system
triggers a bunch of irritating “security zone” checks.

On Fri, Jan 30, 2009 at 1:16 AM, David Craig wrote:

> You can disable the recycle bin on a per drive basis. Right click ‘Recyle
> Bin’ and choose ‘Properties’. You can set it under Global for all drives
> or
> by choosing the per drive choice you can disable the recycle bin on each
> drive as you desire. You can control how much space will be allocated for
> the recycle bins.
>
> “Ayush Gupta” wrote in message news:xxxxx@ntfsd…
> >My intent here is to stop Windows Explorer from trying to implement
> > >Recycle Bin behavior for my file system driver – there’s really no
> sense
> > >in having this in my particular file system, given that the user can
> > >easily “undelete” a file in other ways, without needing to keep an extra
> > >copy around in some magic folder (whose existence causes other
> problems).
>
> If I remember correctly, there is a registry setting using which you can
> turn on/off recycle bin.
> I think it is:
>
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\NukeOnDelete
>
> Regards,
> Ayush Gupta
>
>
>
> Add more friends to your messenger and enjoy! Go to
> http://messenger.yahoo.com/invite/
>
>
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Matt Craighead
Founder/CEO, Conifer Systems LLC
http://www.conifersystems.com
512-772-1834

I checked with dumpbin and found tha Explorer do not import GetDriveType.

I also faced this issue in a project where we developed a mini filter driver. IIRC than it probably have something to do with recycler folder at the root of a partition.(this could be different too, you need to check the exact name).

Explorer try to locate the older, if not found than it try to create that and now I am guessing that If create also fails than it can not move file to recycle bin so it delete it permanently. we never allowed it to have such folder on our virtual drive and it worked.

I saw this behavior in XP/Vista 32 bit.

Thanks,
Aditya

My keyboard ‘F Key is giving me problem’. Please assume F where ever you found it missing. :slight_smile:

for example

Explorer try to locate the older
it is *locate the Folder.*

>I checked with dumpbin and found tha Explorer do not import GetDriveType.

Explorer.exe? so what? all Explorer’s objects are implemented in shell32.dll except the window frame.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

>>Explorer.exe? so what? all Explorer’s objects are implemented in shell32.dll except the window frame.

This is information for me. thanks maxim for the input.

Aditya

Thanks for the suggestion, I prevented creation of “\Recycled” and now I am
getting the desired behavior.

On Sat, Jan 31, 2009 at 10:52 PM, wrote:

> I checked with dumpbin and found tha Explorer do not import GetDriveType.
>
> I also faced this issue in a project where we developed a mini filter
> driver. IIRC than it probably have something to do with recycler folder at
> the root of a partition.(this could be different too, you need to check the
> exact name).
>
> Explorer try to locate the older, if not found than it try to create that
> and now I am guessing that If create also fails than it can not move file to
> recycle bin so it delete it permanently. we never allowed it to have such
> folder on our virtual drive and it worked.
>
> I saw this behavior in XP/Vista 32 bit.
>
> Thanks,
> Aditya
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Matt Craighead
Founder/CEO, Conifer Systems LLC
http://www.conifersystems.com
512-772-1834