Originally Posted By: Tchaymutukikaari

....
it works but I want to know what is happening.
....


Basically what it does is get the size of the folder specified by $directory = %windir%. It retrieves the total size of that folder including all items and sub folders and divide it by 1024 three times to get the size in GB. To get the size of the folder it uses FSO (FileSysemObject).

%windir% can be changed to the folder you need. For example if you have folder called TestFolder on your D drive it could do the same for that folder by changing $Directory = %windir% to $Directory = "D:\TestFolder".
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.