am632 3 Posted March 14, 2011 Hi, I have an imputbox which when you click the browse buton you can choose a directory - then when you click ok, the inputbox is automatically updated with the directory you chose which works fine, but id like to display a lable of the freespace of that folder in MB. I think i need to do this using drivespacefree but im not sure exactly what i need to do, can anyone help please? thanks Share this post Link to post Share on other sites
JohnOne 1,603 Posted March 15, 2011 (edited) $folder = FileSelectFolder("Choose a folder.", "") MsgBox(0,"",$folder) $space = DriveSpaceFree( StringLeft($folder,3) ) MsgBox(4096, "Free space on " & StringLeft($folder,3) , $space & "MB") Edited code Edited March 15, 2011 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
am632 3 Posted March 15, 2011 (edited) Hi, thanks for the reply - works gr8. Just 1 question, how do I round it so there isnt a long decimal? thanks EDIT: I changed the line of code to read $SPACEDETECTEDRESULT = GUICtrlCreateLabel($FREESPACEONDRIVE /1024 & " GB", 220, 400, 170, 22) which works and displays the correct number 134 in my case, but there are loads of numbers behind the decimal point. how can i get rid of them? thanks Edited March 15, 2011 by am632 Share this post Link to post Share on other sites
JohnOne 1,603 Posted March 15, 2011 $SPACEDETECTEDRESULT = GUICtrlCreateLabel(Floor($FREESPACEONDRIVE /1024) & " GB", 220, 400, 170, 22) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
am632 3 Posted March 15, 2011 Thanks a lot, I appreciate your help Share this post Link to post Share on other sites
JohnOne 1,603 Posted March 15, 2011 If you want there to be decimal places, use Round($FREESPACEONDRIVE /1024, 2) ; 2 meaning 2 decimal places. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
Grangato 0 Posted March 31, 2011 If you want there to be decimal places, use Round($FREESPACEONDRIVE /1024, 2) ; 2 meaning 2 decimal places.What would be the final full code? Share this post Link to post Share on other sites
hannes08 39 Posted March 31, 2011 $folder = FileSelectFolder("Choose a folder.", "") MsgBox(0,"",$folder) $space = Round(DriveSpaceFree( StringLeft($folder,3) ) / 1024, 2) MsgBox(4096, "Free space on " & StringLeft($folder,3) , $space & "MB") Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Share this post Link to post Share on other sites