robmason Posted March 24, 2008 Share Posted March 24, 2008 The following script yields some wide discrepancy than what the OS is reporting: $free = driveSpaceFree("C:") $total= driveSpaceTotal("C:") msgbox(4096,@COMPUTERNAME,"total=" & $total & " free=" & $free) See the attachement for output and what properties of my C: drive looks like. I'm wondering why the vast discrepancy? I understand that they come across in MB, but the total is way off. This is running on Windows XP SP2 (32b) Thanks Rob Link to comment Share on other sites More sharing options...
DarkMatter Posted March 24, 2008 Share Posted March 24, 2008 (edited) Doing this: $free = driveSpaceFree("C:") / 1024 $total= driveSpaceTotal("C:") / 1024 msgbox(4096,@COMPUTERNAME,"total=" & $total & " free=" & $free) I didn't have a huge discrepancy. Just a few decimal points and thats due to the dropping the last few decimal places. DriveSpaceFree and DriveSpaceTotal returns in Megabytes if you just devide that by 1024 that will give you how many gigs are free. Edited March 24, 2008 by MattWise [sub]Quantum mechanics: The dreams stuff is made of[/sub] Link to comment Share on other sites More sharing options...
weaponx Posted March 24, 2008 Share Posted March 24, 2008 Usually there are going to be differences because the page file and temp folder change size dynamically. I get discrepencies if I check the drive properties and run my script a few seconds later. If I launch my script and hit the properties very quickly the numbers match just fine. Link to comment Share on other sites More sharing options...
robmason Posted March 24, 2008 Author Share Posted March 24, 2008 Excellent guys - that makes sense now. Thanks Rob 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