Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objLocalFolder = objFSO.GetFolder(strArg)
If objLocalFolder = Empty Then
WScript.Echo "Invalid Path"
WScript.Quit
End If
longLocalFolderSize = objLocalFolder.Size
If longLocalFolderSize>=1024 And longLocalFolderSize<1024*1024 Then
strSizeMess = Round( longLocalFolderSize/1024, 3 ) & " K"
ElseIf longLocalFolderSize>=1024*1024 And longLocalFolderSize<1024*1024*1024 Then
strSizeMess = Round( longLocalFolderSize/1024/1024, 3 ) & " M"
ElseIf longLocalFolderSize>=1024*1024*1024 Then
strSizeMess = Round( longLocalFolderSize/1024/1024/1024, 3 ) & " G"
Else
strSizeMess = longLocalFolderSize & " B"
End If
WScript.Echo strSizeMess
Set objFSO = Nothing
Set objLocalFolder = Nothing
WScript.Quit
新闻热点
疑难解答