- @if(0)==(0) echo off
- CScript.exe /NoLogo /E:JScript %0
- pause & exit
- @end
- var n=1024,m=1048576,fso=new ActiveXObject("Scripting.FileSystemObject");
- var Folder=fso.GetFolder(WScript.Arguments.Count()?WScript.Arguments.Item(0):".");
- for(var e=new Enumerator(Folder.SubFolders);!e.atEnd();e.moveNext()){
- var f=e.item();
- var Size=f.Size;
- switch(true){
- case Size<n :
- WScript.Echo(f.Name,'\t' + Size,' Byte');
- break;
- case Size<m :
- WScript.Echo(f.Name,'\t' + (Size/n).toFixed(2),' KB');
- break;
- default :
- WScript.Echo(f.Name,'\t' + (Size/m).toFixed(2),' MB');
- }
- }
复制代码
|