Question : How to hide a folder based on file size minimum

Hello, I'm hoping someone can help me out.

I'm trying to figure out how to hide folders whose contents are less than 200mb in size. I want to run this script on a schedule and have it

Scan the directory E:\--TV--\

Cycle through each top level folder in the directory and determine folder contents space

< 200mb in size = Hide
> 201mb in size = Visible

Can someone point me in the right direction or help out?

Thanks

Josh

Answer : How to hide a folder based on file size minimum

This is PowerShell solution:
1:
2:
3:
4:
5:
$fs = New-Object -ComObject scripting.filesystemobject
Get-ChildItem E:\--TV--\ -force | Where-Object {$_.psiscontainer} | ForEach-Object {
	if($fs.getfolder($_.fullname).size -lt 200mb) {$_.attributes = "directory,hidden"}
	else{$_.attributes = "directory"}
}
Random Solutions  
 
programming4us programming4us