Sign in to follow this  
Followers 0
chaos945

Drive Info Tool

5 posts in this topic

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

Share this post


Link to post
Share on other sites



Great Job.

Ian


"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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!

Share this post


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)

Share this post


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
Sign in to follow this  
Followers 0