Jump to content

Progressbar showing DriveSize


dash007
 Share

Recommended Posts

Maybe something like this:

#include <GuiConstants.au3>

$total = DriveSpaceTotal("C:")
$free = DriveSpaceFree("C:")
$used = $total - $free

GuiCreate("C: drive:  " & Round($total/1024,2) & " GB total ", 400, 100)
$progress = GuiCtrlCreateProgress(20, 20, 300, 30)

GuiCtrlSetData($progress,  100 * $used / DriveSpaceTotal("C:"))

GuiCtrlCreateLabel(Round($used/1024,2) & " GB used ", 70, 70)
GuiCtrlCreateLabel(Round($free/1024,2) & " GB free ", 230, 70)

GuiSetState()
While GuiGetMsg() <> $GUI_EVENT_CLOSE
WEnd
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

So I started tinkering. I made a version that monitors Drives, changes bar color based on % of fullness, and also handles flash drives.

Select multiple drives by seperating w/ a ',' ie: C:,D:,F:,N:

Configure and Exit by right-click in the window(this is buggy you need to select an area w/o label or progress bar, I use upper left corner)

Disk_Monitor.zip

Edited by Ejoc
Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
Link to comment
Share on other sites

Yah.. thats pretty sweet. Suggestion: make it scan drive letters, say once every 30 seconds or so to enumerate drives. I have 8 or more network drives at any given time and they change regularly. Yes, I know I'm abnormal. Just sayin'

601DisengageEnd Program

Link to comment
Share on other sites

Made a small addition, added an Update field so you can slow down how often it checks your drives, default is now every 30 seconds.

I havent added the auto scanning, as it wont be super easy. The gui is built on how many drives you are watch, so if the number of drives is adjusting then I would need to rebuild the gui, not impossible but I'm lazy atm :)

EDIT

Also its really inteded to be run form the .exe, as it will restart itself when you configure it, running the .au3 requires a manual restart.

Edited by Ejoc
Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
Link to comment
Share on other sites

running the .au3 requires a manual restart.

<{POST_SNAPBACK}>

Here's a trick.

If NOT $CmdLine[0] Then
   MsgBox(64, "Test", "Script will now restart...")
   If @Compiled Then
      Run(@ScriptFullPath & " restart")
   Else
      Run(@AutoItExe & ' "' & @ScriptFullPath & '" restart')
   EndIf
Else
   MsgBox(64, "Test", "Script has restarted itself succesfully!")
EndIf
Link to comment
Share on other sites

Since this has now been asked in another thread, here's a quick and dirty drive enumerator:

Func EnumerateDrives ()
  $szDrivestr = "C:\"
  For $dl = 68 To 93
    $drive = chr ($dl) & ":\"
    DriveGetFileSystem ($drive)
    If @error = 0 Then $szDrivestr = $szDrivestr & "," & $drive
  Next
EndFunc

Yes, I know not everybody has a C drive, but I really don't care. :)

601DisengageEnd Program

Link to comment
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
 Share

  • Recently Browsing   0 members

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