Sign in to follow this  
Followers 0
hot202

file/folder properties from deleted item?

12 posts in this topic

Hey is there anyway to get the file properties from a file or folder that has been deleted?

Or is there anyway to get the file path to the recycle bin directory?

Share this post


Link to post
Share on other sites



Hey is there anyway to get the file properties from a file or folder that has been deleted?

Or is there anyway to get the file path to the recycle bin directory?

Can't access to file properties if deleted Posted Image

C:\RECYCLER, D:\RECYCLER, E:\RECYCLER


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

damn thanks anyway

Share this post


Link to post
Share on other sites

wakillon,

You give in too easily! ;)

hot202,

Try this: ;)

; Credit to Prog@ndy

$objRecycleBin = _GetRecycleBin()

If IsObj($objRecycleBin) Then

    ; Get Special Folder based upon input name
    $objFolderItems = $objRecycleBin.Items() ; Get items within Recycle Bin

    For $objItem In $objFolderItems
        If ($objItem.Type = "File Folder") Then
            ConsoleWrite("FOLDER:" & @CRLF)
        Else
            ConsoleWrite("FILE:" & @CRLF)
        EndIf
        ConsoleWrite("ORIGINAL FILENAME: " & $objRecycleBin.GetDetailsOf($objItem, 0) & @CRLF)
        ConsoleWrite("ORIGINAL PATH: " & $objRecycleBin.GetDetailsOf($objItem, 1) & @CRLF)
        ConsoleWrite("DELETED DATE: " & $objRecycleBin.GetDetailsOf($objItem, 2) & @CRLF)
        ConsoleWrite("FILESIZE: " & $objRecycleBin.GetDetailsOf($objItem, 3) & @CRLF)
        ConsoleWrite("FILETYPE DESCRIPTION: " & $objRecycleBin.GetDetailsOf($objItem, 4) & @CRLF)
        ConsoleWrite("DATE CREATED: " & $objRecycleBin.GetDetailsOf($objItem, 5) & @CRLF)
        ConsoleWrite("DATE ACCESSED: " & $objRecycleBin.GetDetailsOf($objItem, 6) & @CRLF)
        ConsoleWrite("DATE MODIFIED: " & $objRecycleBin.GetDetailsOf($objItem, 7) & @CRLF)
        ConsoleWrite("FILE ATTRIBUTES: " & $objRecycleBin.GetDetailsOf($objItem, 8) & @CRLF & @CRLF)
    Next
Else
    MsgBox(0, "", "Could not find Recycle Bin")
EndIf

Func _GetRecycleBin()
    Local $objShellApp = ObjCreate("Shell.Application")
    Local $ssfBITBUCKET = 10
    Return $objShellApp.NameSpace($ssfBITBUCKET)
EndFunc   ;==>_GetRecycleBin

Enjoy! :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Joli ! Posted Image

But the question was "get the file properties from a file or folder that has been deleted"

They are not deleted in RecycleBin !

And i does'nt see the RecycleBin path in your answer !

Et toc ...Posted Image

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

i found this with google but i dont really understand it but dose it mean you can get the properties?

Const RECYCLE_BIN = &hA&

Dim objShell: Set objShell = _
CreateObject("Shell.Application")
Dim objShellFolder: Set objShellFolder = _
objShell.Namespace(RECYCLE_BIN)

Dim arrHeaders(33), i
'Get the descriptions of available info
For i = 0 to 33
arrHeaders(i) = i & vbTab & _
objShellFolder.GetDetailsOf(objShellFolder.Items, i)
Next
'MsgBox Join(arrHeaders, vbCrLf)

Dim strFileName, iResponse
For Each strFileName in objShellFolder.Items
sMsg = ""
'Get the info associated with each description
For i = 0 to 33
sMsg = sMsg & arrHeaders(i) & _
Next

iResponse = MsgBox(sMsg, 1)
If iResponse = 2 Then WScript.Quit
Next

Share this post


Link to post
Share on other sites

wakillon,

They are not deleted in RecycleBin

OK - 15 partout! ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

this cant be changed to work?

Const $RECYCLE_BIN = 10
Const $FILE_SIZE = 5

Local $objShell = ObjCreate("Shell.Application")
If IsObj ($objShell) Then

Else
    MsgBox (0, "ERROR", "Shell.Application is not an object.")
EndIf
Local $objFolder = $objShell.Namespace($RECYCLE_BIN)

Local $colItems = $objFolder.Items
Local $strSize, $intSize

For $objItem in $colItems
    $strSize = $objFolder.GetDetailsOf($objItem, $FILE_SIZE)
    $arrSize = StringTrimRight($strSize, 3)
    $intSize = $intSize + $arrSize
    MsgBox(1,"test", $intSize)

Next

ConsoleWrite( $intSize & " KB")

Share this post


Link to post
Share on other sites

hot202,

this cant be changed to work?

Of course it can! ;)

Const $RECYCLE_BIN = 10
Const $FILE_SIZE = 3

Local $objShell = ObjCreate("Shell.Application")
If Not IsObj($objShell) Then
    MsgBox (0, "ERROR", "Shell.Application is not an object.")
    Exit
EndIf

Local $objFolder = $objShell.Namespace($RECYCLE_BIN)

Local $colItems = $objFolder.Items
Local $strSize, $intSize

For $objItem in $colItems
    $strName = $objFolder.GetDetailsOf($objItem, 0)
    $strSize = $objFolder.GetDetailsOf($objItem, $FILE_SIZE)
    ConsoleWrite($strName & " = " & $strSize & @CRLF)
Next

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Melba23

I prefer your first solution, there is more informations Posted Image


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

so if i want to get the full properties of a file like the song title and stuff, im best to check if its in the recycle bin still and if it is move it out then get the properties then delete the item again? or would there be a better way to do this?

Share this post


Link to post
Share on other sites

hot202,

As far as I know, the only properties you can retrieve from files in the ReCycle bin are those in my earlier post. If you want the more advanced ones, I think you will have to undelete the file first.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0