本帖最后由 apang 于 2014-5-14 13:35 编辑
保存为test.vbs,更改第一行路径为实际路径- path = "d:\Test"
- Set fso = CreateObject("Scripting.FileSystemObject")
- Set dic = CreateObject("Scripting.Dictionary")
-
- For Each f in fso.GetFolder(path).Files
- strName = LCase(fso.GetBaseName(f))
- If dic.Exists(strName) Then
- dic.Item(strName) = dic.Item(strName) + f.Size
- Else
- dic.Add strName, f.Size
- End If
- Next
-
- For Each a in dic.Keys
- s = s & a & ".*" & vbTab & dic.Item(a) & " Byte" & vbCrLf
- Next
-
- fso.CreateTextFile("Result.txt", true).Write s
- CreateObject("WScript.Shell").Run "NotePad Result.txt"
复制代码
|