Site icon Winhelponline

How to Pin Recycle Bin to Quick Access using InvokeVerb

The Recycle Bin context menu doesn’t have the “Pin to Quick access” context menu. However, you can still pin it to Quick access using the methods in this article. We will see how to pin Recycle Bin to Quick access manually as well as using a script.

How to Pin Recycle Bin to Quick Access

Option 1

Open the Recycle Bin folder. By default, it opens to the “Manage”/”Recycle Bin Tools” tab. Click on the Home tab, and click Pin to Quick access. Alternatively, you can drag the Recycle Bin desktop icon to the Quick access area in a folder window and drop it.


Option 2: Using Script (“InvokeVerb” method)

VBScript


'Pin Recycle Bin to Quick Access - VBScript code
Dim oShell: Set oShell = CreateObject("Shell.Application")
Dim WshShell: Set WshShell = CreateObject("Wscript.Shell") 
sRB = "{645FF040-5081-101B-9F08-00AA002F954E}"
sKey = "HKCU\Software\Classes\CLSID\" & _
sRB & "\shell\pintohome\command\"
WshShell.RegWrite sKey & "DelegateExecute", _
"{b455f46e-e4af-4035-b0a4-cf18d2f6f28e}", "REG_SZ"
oShell.Namespace("shell:::" & sRB).Self.InvokeVerb("pintohome")
On Error Resume Next
WshShell.RegDelete sKey
WshShell.RegDelete "HKCU\Software\Classes\CLSID\" & sRB & "\shell\pintohome\"
WshShell.RegDelete "HKCU\Software\Classes\CLSID\" & sRB & "\shell\"
WshShell.RegDelete "HKCU\Software\Classes\CLSID\" & sRB & "\"
On Error GoTo 0
Set oShell = Nothing
Set WshShell = Nothing

PowerShell

$RBPath = "HKCU:\Software\Classes\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\shell\pintohome\command\"
$name = "DelegateExecute"
$value = "{b455f46e-e4af-4035-b0a4-cf18d2f6f28e}"
New-Item -Path $RBPath -Force | out-null
New-ItemProperty -Path $RBPath -Name $name -Value $value -PropertyType String -Force | out-null
$oShell = New-Object -ComObject Shell.Application
$trash = $oShell.Namespace("shell:::{645FF040-5081-101B-9F08-00AA002F954E}")
$trash.Self.InvokeVerb("PinToHome")
Remove-Item -Path "HKCU:\Software\Classes\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}" -Recurse

Hint: The trick is to temporarily create a PintoHome verb under the Recycle Bin GUID. This is because the PintoHome verb under HKCR\Folder doesn’t work for the Recycle Bin special folder due to a folder GUID validation being in place. After invoking the verb and pinning the item, the PintoHome verb under the Recycle Bin GUID can be removed.

Exit mobile version