Jump to content

Recommended Posts

More fun with progress bars, this tool finds the free/total/label/type of drives on your computer and displays them!Esc to Exit

Page Down for next drive

Page Up to go back

Anyone with some good ideas on what to add to this?

HotKeySet( "{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
Link to post
Share on other sites

Very nice idea :ph34r: .. 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)
Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...