Valuater Posted September 28, 2010 Share Posted September 28, 2010 (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 September 28, 2010 by Valuater Link to comment Share on other sites More sharing options...
Valuater Posted September 28, 2010 Author Share Posted September 28, 2010 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) Link to comment Share on other sites More sharing options...
czardas Posted September 28, 2010 Share Posted September 28, 2010 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. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now