views:

271

answers:

2

Does anyone know how to set the Maximum Size of the Recycle Bin via script? Whether its written in batch or vbs or just a reg file? I've been exploring this idea for the last few days, and can't get an answer. Maybe someone here knows how. I'm wanting to add it to my Vista Cleanup Script =)

A: 

This isn't something code should be able to do, therefore there probably isn't a way. Seems like something Raymond Chen would blog about.

Why would you want to do that?

tsilb
He wants to add it to his Vista cleanup script! ;)
Ben Alpert
How can you sleep at night?
efotinis
On a bed made out of MONEY!
tsilb
+1  A: 

The maximum size of the Recycle Bin for each drive is stored under this key:

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume\

There's a subkey with the GUID of each mounted volume. This GUID can be found with the MOUNTVOL command, or programmatically with GetVolumeNameForVolumeMountPoint().

You can just change the size value and it will be picked up by Explorer the next time something is deleted (i.e. you don't need to notify the shell about the change).

efotinis