SC report and the Recycle Bin

Things you’d like to miss in the future...
Post Reply
jupe
Posts: 2749
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

SC report and the Recycle Bin

Post by jupe »

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,

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>)); }
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.

admin
Site Admin
Posts: 60288
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: SC report and the Recycle Bin

Post by admin »

Shell Property IDs for Recycle Bin items seem to be different fields than when in normal locations
Yep, and it's weird that the shell itself does not seem to know about that, because it could tell from the path that this item is in the recycle bin. I see no possible fix there, so Shell Property IDs will just not work for Recycle Bin.

I could fix the error 9, and the returned report for a passed location will work now no matter where the list is pointing at at that moment.

Post Reply