Home All Groups Group Topic Archive Search About
Author
23 May 2005 9:36 AM
Stlun
Is there a way in VB to delete a file thats located on a USB memorystick and
"move" it to C:\recycle bin ?

I want the operator to have a chance to restore the file again.

/Stlun

Author
23 May 2005 10:05 AM
Mike D Sutton
> Is there a way in VB to delete a file thats located on a USB memorystick and
> "move" it to C:\recycle bin ?
>
> I want the operator to have a chance to restore the file again.

The SHFileOperation() API call allows you to delete a file to the recycle bin, although I'm not sure if it will properly
when deleted files from removable media such as your USB memory stick - does Windows?  Your other option is to keep a
local filter on your hard drive and either keep a copy of all the files in there or just those that have been deleted.
Hope this helps,

    Mike


- Microsoft Visual Basic MVP -
E-Mail: ED***@mvps.org
WWW: Http://EDais.mvps.org/
Author
23 May 2005 2:20 PM
Stlun
Show quote Hide quote
"Mike D Sutton" wrote:

> > Is there a way in VB to delete a file thats located on a USB memorystick and
> > "move" it to C:\recycle bin ?
> >
> > I want the operator to have a chance to restore the file again.
>
> The SHFileOperation() API call allows you to delete a file to the recycle bin, although I'm not sure if it will properly
> when deleted files from removable media such as your USB memory stick - does Windows?  Your other option is to keep a
> local filter on your hard drive and either keep a copy of all the files in there or just those that have been deleted.
> Hope this helps,
>
>     Mike
>
>
>  - Microsoft Visual Basic MVP -
> E-Mail: ED***@mvps.org
> WWW: Http://EDais.mvps.org/
>
>
>

Thanks for the tip, and yes when deleting a file from a  removable media or
networkdisk windows doesn't give you a restorepossebility. To get a
restoreoption I do a interim storage to c:\app.path and then deletes it from
there into recycle bin with SHFileOperation.

/Stlun
Author
23 May 2005 12:17 PM
Peter Aitken
"Stlun" <st***@DELETE.THIS.hotmail.com> wrote in message
news:2A4FB9D6-E1BA-4AED-9954-C9C238AAFA1F@microsoft.com...
> Is there a way in VB to delete a file thats located on a USB memorystick
> and
> "move" it to C:\recycle bin ?
>
> I want the operator to have a chance to restore the file again.
>
> /Stlun

http://www.pgacon.com/visualbasic.htm#Deleting%20Files%20to%20the%20Recycle%20Bin



--
Peter Aitken

Remove the crap from my email address before using.