dash007 Posted March 24, 2005 Posted March 24, 2005 Hi, does anyone know of a script on how to get a gui (progressbar) that reads the size of the harddrive. Thanks in advance
CyberSlug Posted March 24, 2005 Posted March 24, 2005 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!
Ejoc Posted March 25, 2005 Posted March 25, 2005 (edited) 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 May 1, 2005 by Ejoc Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
dash007 Posted March 26, 2005 Author Posted March 26, 2005 Ejoc, Very impressive. I like the interface!
Smed Posted March 26, 2005 Posted March 26, 2005 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
Ejoc Posted March 26, 2005 Posted March 26, 2005 (edited) 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 March 26, 2005 by Ejoc Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
SlimShady Posted March 26, 2005 Posted March 26, 2005 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
Ejoc Posted March 26, 2005 Posted March 26, 2005 (edited) Thanks SlimShadyThat plus a better config window have been addedPost w/ File Or go up some Edited March 26, 2005 by Ejoc Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
Smed Posted March 28, 2005 Posted March 28, 2005 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
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