how to get deleted date in recycle bin

Zexor

Well-known member
Joined
Nov 28, 2008
Messages
520
Programming Experience
3-5
How do i get the deleted date on files in the recycle bin? I could get the file name and modifydate ok in a shell32.folder recyclebin object.
Also, if i want to delete a file that is already in the recycle bin, i need an API call?
 
Last edited:
Then how do i delete a file that is already in the recycle bin? do i just delete the file in C:\$Recycle.Bin\.
Or do i need SHFileOperation?
 
Last edited:
The FolderItem has a Verbs collection with the methods that you can do with the item, among them the Delete verb.
 
I really dont see how to use the verbs. This is what i have.
VB.NET:
Dim SH As New Shell32.Shell
Dim RecycleBin As Shell32.Folder = SH.NameSpace(Shell32.ShellSpecialFolderConstants.ssfBITBUCKET)


For Each Item As Shell32.FolderItem In RecycleBin.Items

Next
say i want to delete the first item there, how do i delete it?
 
Loop the Verbs collection to find the Delete verb object, each item in the collection is of type FolderItemVerb. Then either use FolderItem.InvokeVerb method or call the FolderItemVerb.DoIt method.
 
You mean like this?
VB.NET:
Dim SH As New Shell32.Shell
Dim RecycleBin As Shell32.Folder = SH.NameSpace(Shell32.ShellSpecialFolderConstants.ssfBITBUCKET)

For Each Item As Shell32.FolderItem In RecycleBin.Items
    for i = 0 to item.verbs.count-1
        If item.verbs.item(i).name.contains("Delete") then
                item.verbs.item(i).doit()
        End if
    next
Next
 
everytime when on the line .doit() it will popup a message box asking if i want to delete the file. Can i have it not show that message box and just do it?
 
I don't see any options in that library, but File.Delete(item.Path) seems to do the trick.
 
Back
Top