标题: [已解决]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- #du 1.1- report directory disk usage
- Write-Host DU 1.1 - 统计目录大小的脚本,作用和linux的du类似。`n
- # pwershell交流群出品
- # 群号=183173532
- if (!$args)
- {write-host "du 绝对目录名,如:`ndu.ps1 d:\mp3"}
- else
- {
- if (!(Test-Path $args))
- {write-host "错误:找不到目标目录名!"}
- else
- {
- # 2010-8-15日出炉
- $a=Get-ChildItem $args | Where-Object {$_.PsIsContainer -eq $true}
- foreach ($i in $a)
- {
- $subFolderItems = (Get-ChildItem $i.FullName -Recurse | Measure-Object -property length -sum)
- $i.FullName + " -- " + "{0:N2}" -f ($subFolderItems.sum / 1MB) + " MB"
- }
- $b=Get-ChildItem $args -Recurse | Measure-Object -property length -sum
- write-host "----【$args -- ",("{0:N2}" -f ($b.sum / 1MB)),"MB】----"
- }
- }
复制代码
作者: DAIC 时间: 2013-12-29 08:10
回复 2# changedirectory
代码贴出来给大家分享一下吧
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |