i working in software company. i've used batch file folder size using dir , du took 1 sec in dir , 600 msec in du calculate folder size of 5gb. want faster product. there command or tool command line support can perform task faster? command can of type (bat, vbs, powershell....)
thank in advance....
powershell solution.
read more @ https://technet.microsoft.com/en-us/library/ff730945.aspx
$colitems = (get-childitem c:\temp -recurse | measure-object -property length -sum) "{0:n2}" -f ($colitems.sum / 1mb) + " mb" measures:
ps c:\> measure-command -expression { $colitems = (get-childitem c:\temp -recurse | measure-object -property length -sum) "{0:n2}" -f ($colitems.sum / 1mb) + " mb" } days : 0 hours : 0 minutes : 0 seconds : 2 milliseconds : 509 ticks : 25092400 totaldays : 2,90421296296296e-05 totalhours : 0,000697011111111111 totalminutes : 0,0418206666666667 totalseconds : 2,50924 totalmilliseconds : 2509,24 same shell com object:
$objfso = new-object -comobject scripting.filesystemobject "{0:n2}" -f (($objfso.getfolder("c:\temp").size) / 1mb) + " mb" measures:
ps c:\> measure-command -expression { $objfso = new-object -comobject scripting.filesystemobject "{0:n2}" -f (($objfso.getfolder("c:\temp").size) / 1mb) + " mb" } days : 0 hours : 0 minutes : 0 seconds : 0 milliseconds : 719 ticks : 7197995 totaldays : 8,33101273148148e-06 totalhours : 0,000199944305555556 totalminutes : 0,0119966583333333 totalseconds : 0,7197995 totalmilliseconds : 719,7995
Comments
Post a Comment