SC report and the Recycle Bin
Posted: 05 Dec 2022 22:19
I noticed that when using SC report and using shell properties the returns given are bogus when in the Recycle Bin location, but if queried individually via SC property the values are good.
Of course when trying to do a report on the Recycle Bin via GUI that location isn't found/supported, so this may not be something you want to devote time to fixing anyway, personally I don't really use the Recycle Bin so this is just an observation, not something I am requesting to be fixed, but for example being able to query this info would allow custom sorting etc via scripting. (without indiv calls to property)
Anyway here is an example, notice the first 2 fields have bogus values in SC report return, but not property,
Another thing I'll mention, but is probably to be expected, all the Shell Property IDs for Recycle Bin items seem to be different fields than when in normal locations, for example for me on Win10 #2 is usually Type, but in Recycle Bin it is DateDeleted UTC adjusted (may be diff again on Win8.1 too), so if you use SC property and ask it to return the field name (suffix n) it reports the incorrect name.
Additionally if you have the Recycle Bin location open in the current tab and happen to run a script that utilizes SC report but on another set of files/folders, it creates an Error 9 dialog and fails, for example if you choose to run the last line in the above script, so it seems running a script with the Recycle Bin tab open would create issues.
Of course when trying to do a report on the Recycle Bin via GUI that location isn't found/supported, so this may not be something you want to devote time to fixing anyway, personally I don't really use the Recycle Bin so this is just an observation, not something I am requesting to be fixed, but for example being able to query this info would allow custom sorting etc via scripting. (without indiv calls to property)
Anyway here is an example, notice the first 2 fields have bogus values in SC report return, but not property,
Code: Select all
goto "%recycler%";
text report("{prop:#2}|{prop:DateDeleted}|{Name}<crlf>");
$item = gettoken(<allitems |>, rand(1, <get countitems>), "|");
text property("#2", $item) . "|" . property("DateDeleted", $item) . "|" . property("Name", $item);
if (confirm("Invoke Error 9 dialog?")) { text report("{Name}<crlf>", listfolder(<xypath>)); }
Additionally if you have the Recycle Bin location open in the current tab and happen to run a script that utilizes SC report but on another set of files/folders, it creates an Error 9 dialog and fails, for example if you choose to run the last line in the above script, so it seems running a script with the Recycle Bin tab open would create issues.