hot202 0 Posted September 3, 2010 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
wakillon 403 Posted September 3, 2010 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 C:\RECYCLER, D:\RECYCLER, E:\RECYCLER AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Share this post Link to post Share on other sites
hot202 0 Posted September 3, 2010 damn thanks anyway Share this post Link to post Share on other sites
Melba23 3,456 Posted September 3, 2010 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Share this post Link to post Share on other sites
wakillon 403 Posted September 3, 2010 (edited) Joli ! 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 ... Edited September 3, 2010 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Share this post Link to post Share on other sites
hot202 0 Posted September 3, 2010 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
Melba23 3,456 Posted September 3, 2010 wakillon,They are not deleted in RecycleBinOK - 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Share this post Link to post Share on other sites
hot202 0 Posted September 3, 2010 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
Melba23 3,456 Posted September 3, 2010 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Share this post Link to post Share on other sites
wakillon 403 Posted September 3, 2010 Melba23I prefer your first solution, there is more informations AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Share this post Link to post Share on other sites
hot202 0 Posted September 4, 2010 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
Melba23 3,456 Posted September 4, 2010 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Share this post Link to post Share on other sites