chaos945 Posted August 13, 2004 Posted August 13, 2004 More fun with progress bars, this tool finds the free/total/label/type of drives on your computer and displays them!Esc to ExitPage Down for next drivePage Up to go backAnyone with some good ideas on what to add to this?expandcollapse popupHotKeySet( "{PGDN}", "gotoNext" ) HotKeySet( "{PGUP}", "gotoPrev" ) HotKeySet( "{ESC}", "gotoExit" ) Global $j = 1, $exitscript = 1 WinSetOnTop( "AutoDefrag", "", 0 ) $var = DriveGetDrive( "FIXED" ) ProgressOn( "Drive Info 0.1", "", "", -1, -1, 16 ) For $i = 1 to $var[0] $label = DriveGetLabel( $var[$i] ) $free = DriveSpaceFree( $var[$i] ) $total = DriveSpaceTotal( $var[$i] ) ProgressSet( ( $free * 100 ) / $total, "Free Space: " & Round( $free, 0 ) & " MB" &@LF& "Total Space: " & Round( $total, 0 ) & " MB", "(" & $label & ") - " & $var[$i] & " drive" ) Do Until $j = 0 $j = 1 If $i < 1 Then $i = 0 EndIf If $i >= 6 Then $i = 5 EndIf Next Do Until $exitscript = 0 Func gotoNext() $j = 0 EndFunc Func gotoPrev() $i = $i - 2 $j = 0 EndFunc Func gotoExit() ProgressOff() Exit EndFunc
ioliver Posted August 13, 2004 Posted August 13, 2004 Great Job. Ian "Blessed be the name of the Lord" - Job 1:21Check out Search IMF
emmanuel Posted August 13, 2004 Posted August 13, 2004 cool, I changed the drive type to all to see the free space on the network drives I have mapped, pretty nifty. "I'm not even supposed to be here today!" -Dante (Hicks)
chaos945 Posted August 14, 2004 Author Posted August 14, 2004 Took me forever to figure out how to get the script to halt at one specific drive, and even longer to get it to go backwards in steps! Turned out pretty good though, good idea with the networked drives!
trids Posted August 14, 2004 Posted August 14, 2004 Very nice idea .. it inspired me to try a charting format.. $sBar = "|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ||||" ;... in the absence of a StringRepeat("|",100) ;o) $sOut = $sBar & " = 100% Capacity Baseline" & @LF ProgressOn("Scanning drives", "", "") $aNetDrives = DriveGetDrive( "NETWORK" ) For $nDrv = 1 to $aNetDrives[0] $sDrv = StringUpper($aNetDrives[$nDrv]) ProgressSet(100* $nDrv/$aNetDrives[0], $sDrv & " (" & $nDrv & " of " & $aNetDrives[0] & ")") sleep(10) $nSpaceFree = DriveSpaceFree($sDrv) $nSpaceTotal = DriveSpaceTotal($sDrv) $nPct = 100 * $nSpaceFree / $nSpaceTotal $sOut = $sOut & $sDrv & " (Free=" & StringFormat("%.2fMb",$nSpaceFree) & "; Total=" & StringFormat("%.2fMb",$nSpaceTotal) & ")" & @LF $sOut = $sOut & StringLeft($sBar, $nPct) & " = " & "(" & StringFormat("%.2f",$nPct) & "%)" & @LF Next ProgressOff() Msgbox (0,"Free Space (NETWORK)",$sOut)
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