S
SuperSheep
Guest
Here is another cool little JavaScript. This one checks for the status of the recycle bin...
// Determines if recycle bin has contents
function chkrecycle()
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFolder("C:\\RECYCLER\\S-1-5-21-1214440339-926492609-839522115-1003");
fc = new Enumerator(f.Files);
for(s=-2;!fc.atEnd(); fc.moveNext()) {s++;}
fs = new Enumerator(f.SubFolders);
for(;!fs.atEnd(); fs.moveNext()) {s++;}
if(s>0) return true;
else return false;
}
The number after the C:\\RECYCLER\\ is my ID. Yours will be different. Check it by enabling 'Show Hidden files' and unchecking 'Hide protected operating system file', then navigate to your RECYCLER folder and copy that ID. You should also check to see what YOUR default number of files and folders is. I have 2 drives, so I have 2 files within the directory for each drive. substitute the 2 with your own number of files.
// Determines if recycle bin has contents
function chkrecycle()
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFolder("C:\\RECYCLER\\S-1-5-21-1214440339-926492609-839522115-1003");
fc = new Enumerator(f.Files);
for(s=-2;!fc.atEnd(); fc.moveNext()) {s++;}
fs = new Enumerator(f.SubFolders);
for(;!fs.atEnd(); fs.moveNext()) {s++;}
if(s>0) return true;
else return false;
}
The number after the C:\\RECYCLER\\ is my ID. Yours will be different. Check it by enabling 'Show Hidden files' and unchecking 'Hide protected operating system file', then navigate to your RECYCLER folder and copy that ID. You should also check to see what YOUR default number of files and folders is. I have 2 drives, so I have 2 files within the directory for each drive. substitute the 2 with your own number of files.