Discussion Locked

Recycle Bin

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Is there a group policy that I can set so that the Recycle Bin will get emptied every time a user logs out?

Thanks

4 replies

by bfilmfan

This script will perform that function:

var bin = new ActiveXObject("BinManager.RecycleBin");

// Report the contents of the recycle bin.
function Report(){
WScript.Echo("Recycle Bin Holds\n" + bin.NumItems
+ " items\n" + bin.Size + " bytes\n");
}

Report();

// Permanently delete items recycled more than two days ago.
// Note, the argument is full calendar days, so specifying
// zero would delete all items older than today.
bin.DeleteOldItems(0);
Report();

// Permanently delete all recycled items.
bin.Empty();
Report();

This discussion is closed to new replies.