Sign in to follow this  
Followers 0
Valuater

DirGetSize() problem

3 posts in this topic

#1 ·  Posted (edited)

This little script seems to take forever on some computers.

$size = DirGetSize(@HomeDrive)
Msgbox(0,"","Size(MegaBytes):" & Round($size / 1024 / 1024))

What my desire is, to clean a computer then calculate the amount of room recovered on the hard drive when completed. So, I use this twice which takes twice as long.

Maybe there is a faster way.... check free space... or... ???

Thx

Valuater

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites



Thats ok, ..... I got it

Two as a mater of fact.

$objWMIService = ObjGet("winmgmts:")
$objLogicalDisk = $objWMIService.Get("Win32_LogicalDisk.DeviceID='C:'")
MsgBox(0, 0, Round($objLogicalDisk.FreeSpace / 1024 / 1024 / 1024, 2) & " Gig   ")


$fso = ObjCreate("Scripting.FileSystemObject")
$d = $fso.GetDrive(@HomeDrive)
MsgBox(0, 0, Round($d.FreeSpace / 1024 / 1024 / 1024, 2) & " Gig   ")

thx

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Interesting. It's beyond me, but something did occur to me. If the data removed was much smaller than the amount of data remaining on the drive, then adding up the amount of removed data might be faster than re-examining the whole drive. If that makes any sense. I have no idea.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0