Much less me...
It is currently April 19th, 2024, 2:36 am
Recycle Bin context menu
-
- Rainmeter Sage
- Posts: 16144
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: Recycle Bin context menu
Hi Yincognito and balala
I just thank you for taking time to talk with me, even if my aim wasn't achieved so far.
BTW, as the FileView plugin has [!CommandMeasure SomeMeasure ContextMenu] command (and even Properties!), I assume that the plugin uses some API that calls context menu for file path. If so, RecycleManager measure also can use such API for the integrated RecycleBin and implement similar measure command? ... just my thought, but expect.
I just thank you for taking time to talk with me, even if my aim wasn't achieved so far.
BTW, as the FileView plugin has [!CommandMeasure SomeMeasure ContextMenu] command (and even Properties!), I assume that the plugin uses some API that calls context menu for file path. If so, RecycleManager measure also can use such API for the integrated RecycleBin and implement similar measure command? ... just my thought, but expect.
-
- Rainmeter Sage
- Posts: 7125
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Recycle Bin context menu
But isn't the context menu of the Recycle Bin desktop icon entirely different from the context menu of a $Recycle.Bin folder?mak_kawa wrote: ↑October 15th, 2020, 10:00 pm Hi Yincognito and balala
I just thank you for taking time to talk with me, even if my aim wasn't achieved so far.
BTW, as the FileView plugin has [!CommandMeasure SomeMeasure ContextMenu] command (and even Properties!), I assume that the plugin uses some API that calls context menu for file path. If so, RecycleManager measure also can use such API for the integrated RecycleBin and implement similar measure command? ... just my thought, but expect.
-
- Rainmeter Sage
- Posts: 7125
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Recycle Bin context menu
I think I may have the answer for you, mak_kawa - you know my motto, nothing is impossible. This will most likely work, as Rainmeter has the capability of doing everything required for this.
P.S. It won't open the context menu of Recycle Bin or its properties, but it will do pretty much everything available in the properties window.
EDIT:
I'll be a bit busy tomorrow, so I'll just show you how to do it:
- use either: mountvol /L (in either CMD or PowerShell), WMIC or a PowerShell command like:
Code: Select all
gwmi -class Win32_Volume -filter "NOT DriveLetter like ''" | select DriveLetter,DeviceID | sort DriveLetter | format-list
- once you get the GUID, the registry path of the Recycle Bin settings for your drive will be:
Code: Select all
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume\{GUID}
- to be able to modify those settings, use a PowerShell code like (this sets the maximum storage size of Recycle Bin for C: drive to 5000 MB):
Code: Select all
$Size=5000
$Volume=mountvol C:\ /L
$Guid=[regex]::Matches($Volume,'{([-0-9A-F].*?)}')
$RegKey="HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume\"+$Guid.value
New-ItemProperty -Path $RegKey -Name MaxCapacity -Value $Size -PropertyType "dword" -Force
All in all, if there is a "complicated" part, it's extracting the GUID(s) from the mountvol or gwmi output, but even that isn't that hard if carefully designing the regex. Naturally, you can even replicate the Recycle Bin Properties window in a small skin, if you like - some InputTexts and buttons should do the job, considering that you can already get the current values of those settings using some Registry measures, and the set part is clear.
If you want to implement this and encounter difficulties and such, feel free to use your constitutional right to reply on this forum, LOL. Oh, and yeah, now you can say thanks. The approach is not exactly as easy as envisioned with just a simple CLSID in a bang, but it isn't a whole lot complicated either, and it should work. Obviously, you should first make sure everything goes smooth by running whatever is needed to test this from CMD or PowerShell, and make a backup of the registry before attempting to modify it, just to be on the safe side.
-
- Posts: 1365
- Joined: September 7th, 2020, 2:24 pm
- Location: QLD, Australia
Re: Recycle Bin context menu
There are only three options in the recycle bin menu, really: open, empty, and pin to taskbar - unless you have some other programs linked to it like CCleaner.
There is a lot of stuff about running batch files for each separate option, but not the native menu.
Perhaps creating a context menu that runs individual batch files for each option, named in kind just through rainmeter context menu...
There is a lot of stuff about running batch files for each separate option, but not the native menu.
Perhaps creating a context menu that runs individual batch files for each option, named in kind just through rainmeter context menu...
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
-
- Rainmeter Sage
- Posts: 7125
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Recycle Bin context menu
Something like that, yeah. As far as I am aware of, one of the few ways of accessing the options from the Recycle Bin properties (i.e. the ones setting the size of the bin and such) is to build a skin simulating that properties window, and then modify those options by changing the registry keys I talked about earlier. Of course, one can do that through the skin's context menu as well.CodeCode wrote: ↑October 21st, 2020, 8:47 am There are only three options in the recycle bin menu, really: open, empty, and pin to taskbar - unless you have some other programs linked to it like CCleaner.
There is a lot of stuff about running batch files for each separate option, but not the native menu.
Perhaps creating a context menu that runs individual batch files for each option, named in kind just through rainmeter context menu...
-
- Posts: 1365
- Joined: September 7th, 2020, 2:24 pm
- Location: QLD, Australia
Re: Recycle Bin context menu
Of course... Properties. I didnt include that one. Sorry. Looking around though and I did not see any reference to that in the batch file perspective so back to Yincognito's idea then.Yincognito wrote: ↑October 21st, 2020, 12:15 pm Something like that, yeah. As far as I am aware of, one of the few ways of accessing the options from the Recycle Bin properties (i.e. the ones setting the size of the bin and such) is to build a skin simulating that properties window, and then modify those options by changing the registry keys I talked about earlier. Of course, one can do that through the skin's context menu as well.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
-
- Moderator
- Posts: 1251
- Joined: February 16th, 2012, 3:32 am
- Location: Berlin, Germany
Re: Recycle Bin context menu
CodeCode, Yincognito, balala, mak_kawa,Yincognito wrote: ↑October 15th, 2020, 6:21 pm To be fair, there isn't much to thank me for either, since the essence of the question (i.e. directly accessing the bin properties) has not been solved yet, despite our efforts.
Sorry it took me so long.
Can you guys verify if it works for you on Windows 10/11? It works for me on Windows 7.
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
[BinProperties]
Measure=Plugin
Plugin=FileView
Path="C:\"
ShowDotDot=0
ShowFolder=0
ShowFile=0
UpdateDivider=-1
[MeterName]
Meter=String
X=0R
Y=0r
FontFace=Arial
FontSize=12
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=12,13,12,12
AntiAlias=1
Text=Open Recycle Bin Properties
LeftMouseUpAction=[!CommandMeasure "BinProperties" "Properties shell:::{645FF040-5081-101B-9F08-00AA002F954E}"]
EDIT: I just figured out that it is also possible to open Properties dialogue windows with PowerShell. But let me know first if Rainmeter way works for you
Code: Select all
$o = new-object -com Shell.Application
$folder = $o.NameSpace("shell:RecycleBinFolder")
$folder.Self.InvokeVerb("Properties")
You do not have the required permissions to view the files attached to this post.
-
- Rainmeter Sage
- Posts: 16144
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Recycle Bin context menu
Yep, perfectly works on Windows 10. If needed, here are the system information, as provided by Rainmeter:Active Colors wrote: ↑March 2nd, 2022, 12:17 pm Can you guys verify if it works for you on Windows 10/11? It works for me on Windows 7.
Rainmeter 4.5.7.3581 (64-bit)
Language: English (1033)
Build time: 2021-12-09 15:10:57
Windows 10 Pro 2009 64-bit (build 19044) - English (1033)
-
- Rainmeter Sage
- Posts: 7125
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Recycle Bin context menu
Yes, both the skin and the PS code work for me on Win 10. Setting the FileView's Path option to another value like "D:\" doesn't seem to make any difference (or maybe it's not supposed to) when it comes to what is selected in the bin properties window. I also like the shorter one-line (new-object -com Shell.Application).NameSpace("shell:RecycleBinFolder").Self.InvokeVerb("Properties") version when it comes to PS, but that's just me.Active Colors wrote: ↑March 2nd, 2022, 12:17 pm CodeCode, Yincognito, balala, mak_kawa,
Sorry it took me so long.
Can you guys verify if it works for you on Windows 10/11? It works for me on Windows 7.
[...]
Nice find, even after all this time.