Board logo

标题: [已解决]BAT批处理计算文件的大小超过2147483648后,如何计算? [打印本页]

作者: changedirectory    时间: 2013-12-27 16:04     标题: [已解决]BAT批处理计算文件的大小超过2147483648后,如何计算?

需要统计一个文件夹内所有文件和的大小,但是估计大小有20-30G左右,用什么命令能统计这些文件的大小?谢谢
作者: changedirectory    时间: 2013-12-27 16:19

我自己找到方法了,谢谢!
作者: PowerShell    时间: 2013-12-27 17:18

用我写的du.ps1 群里有
作者: 1270697389    时间: 2013-12-27 17:31

用我写的du.ps1 群里有
PowerShell 发表于 2013-12-27 17:18



    群里面没看到,在哪个群
作者: PowerShell    时间: 2013-12-29 07:55

powershell版中的群        
http://www.bathome.net/thread-26048-1-1.html
  1. #du 1.1- report directory disk usage
  2. Write-Host DU 1.1 - 统计目录大小的脚本,作用和linux的du类似。`n
  3. # pwershell交流群出品
  4. # 群号=183173532
  5. if (!$args)
  6. {write-host "du 绝对目录名,如:`ndu.ps1 d:\mp3"}
  7. else
  8. {
  9. if (!(Test-Path $args))
  10. {write-host "错误:找不到目标目录名!"}
  11. else
  12. {
  13. # 2010-8-15日出炉
  14. $a=Get-ChildItem $args | Where-Object {$_.PsIsContainer -eq $true}
  15. foreach ($i in $a)
  16. {
  17. $subFolderItems = (Get-ChildItem $i.FullName -Recurse  | Measure-Object -property length -sum)
  18. $i.FullName + " -- " + "{0:N2}" -f ($subFolderItems.sum / 1MB) + " MB"
  19. }
  20. $b=Get-ChildItem $args -Recurse | Measure-Object -property length -sum
  21. write-host "----【$args -- ",("{0:N2}" -f ($b.sum / 1MB)),"MB】----"
  22. }
  23. }
复制代码

作者: DAIC    时间: 2013-12-29 08:10

回复 2# changedirectory


    代码贴出来给大家分享一下吧




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2