- @if(0)==(0) echo off
- set "ph=C:\TEST"
- if exist "%ph%\" CScript -NoLogo -E:JScript %0 "%ph%" >new_files.txt
- pause & exit
- @end
- var m=1048576,fso=new ActiveXObject("Scripting.FileSystemObject");
- var Folder=fso.GetFolder(WSH.Arguments.Count()?WSH.Arguments.Item(0):".");
-
- function folders (F, num){
- for(var e=new Enumerator(F.Files);!e.atEnd();e.moveNext()){
- num++;
- }
- return num;
- }
-
- for(var e=new Enumerator(Folder.SubFolders);!e.atEnd();e.moveNext()){
- var F = e.item();
- var n = folders(fso.GetFolder(F.Path),0);
- WSH.Echo(F.Name,"\t", n, "个文件\t", (F.size/m).toFixed(2));
- }
复制代码
|