Jump to content

Need help getting free space on drive


 Share

Recommended Posts

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

Link to comment
Share on other sites

$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 by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

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 by am632
Link to comment
Share on other sites

  • 3 weeks later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...