folderSize.vbs
Set objFileSystem = CreateObject("Scripting.FileSystemObject")
Set objFsf = objFileSystem.GetFolder("C:\Users\e11191\Downloads")
Dim Size
Dim SizeMB
Dim SizeGB
Size = objFsf.Size
SizeMB = Size / 1024 / 1024
SizeGB = Size / 1024 / 1024 / 1024
msg = "Name=" & objFsf.Name & vbCrlf
msg = msg + "Size=" & FormatNumber(Size, 0, 0, 0, -1) & "(" & FormatNumber(SizeMB, 2, 0, 0, -1) & " MB, " & FormatNumber(SizeGB, 2, 0, 0, -1) & " GB)" & vbCrlf
msg = msg + "Files.Count=" & objFsf.Files.Count & vbCrlf
msg = msg + "SubFolders.Count=" & objFsf.SubFolders.Count & vbCrlf
MsgBox msg
0 件のコメント:
コメントを投稿