![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Recycle Bin empty, icon changed correctly, and delete confirmation dialog closed I found this was a tough (read finicky) nut to crack so thought I would post my solution here. Credit to mr_unreliable, et al. On Windows XP SP3, the only way I found I could get the Recycle Bin emptied, icon changed correctly, and the delete confirmation dialog closed was to invoke the Open verb instead of Empty Recycle &Bin. I then perform a few SendKeys calls to navigate through the appropriate menu items, close the dialog, and finally the Recycle Bin window. This script is used as part of a clean up batch file. Delete confirmation dialog is required. Set objShell = CreateObject("Shell.Application") Set WSHShell = CreateObject("WScript.Shell") Const CLSID = "::{645FF040-5081-101B-9F08-00AA002F954E}" Set objRecycleBin = objShell.Namespace(0).ParseName(CLSID) objRecycleBin.InvokeVerb "Open" WScript.Sleep(50) WSHShell.SendKeys("%F") WScript.Sleep(50) WSHShell.SendKeys("B") WScript.Sleep(50) WSHShell.SendKeys("Y") WScript.Sleep(50) WSHShell.SendKeys("%{F4}") |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Recycle Bin empty, icon changed correctly, and delete confirmation dialog closed When was the original discussion on this? I'm having trouble finding it in Google, and I wanted to see what issues you guys had run across - I'm working on a theory about what happens with particular verb invocations from scripts and why. :/ "dp" <dp@xxxxxx> wrote in message news:l96dnQmShNPXBjPUnZ2dnUVZ_sHinZ2d@xxxxxx Quote: > I found this was a tough (read finicky) nut to crack so thought I would > post my solution here. Credit to mr_unreliable, et al. > > On Windows XP SP3, the only way I found I could get the Recycle Bin > emptied, icon changed correctly, and the delete confirmation dialog closed > was to invoke the Open verb instead of Empty Recycle &Bin. I then perform > a few SendKeys calls to navigate through the appropriate menu items, close > the dialog, and finally the Recycle Bin window. > > This script is used as part of a clean up batch file. Delete confirmation > dialog is required. > > Set objShell = CreateObject("Shell.Application") > Set WSHShell = CreateObject("WScript.Shell") > Const CLSID = "::{645FF040-5081-101B-9F08-00AA002F954E}" > Set objRecycleBin = objShell.Namespace(0).ParseName(CLSID) > > objRecycleBin.InvokeVerb "Open" > WScript.Sleep(50) > WSHShell.SendKeys("%F") > WScript.Sleep(50) > WSHShell.SendKeys("B") > WScript.Sleep(50) > WSHShell.SendKeys("Y") > WScript.Sleep(50) > WSHShell.SendKeys("%{F4}") > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Recycle Bin icon will not show empty without manual screen refresh.? | Vista General | |||
| Can I disable "Empty recycle bin" confirmation? | Vista General | |||
| Recycle Bin icon always looks empty? | Vista General | |||
| CHANGE RECYCLE BIN ICON - EMPTY FULL HOW? | Vista General | |||
| recycle bin icon does not empty | Vista performance & maintenance | |||