Jump to content

Find Free Drive Letters


pgr
 Share

Recommended Posts

Hi,

Im messing around with a Network Drive Mapping GUI and need a way to show all unused drive letters in a combo box... has anybody got a clue?

I have no real clue how i could archive this... possible would be a List from A: to Z: and then filter the used entrys out of that list (with DriveGetDrive) i think, but I be thankful for any help on this one ;-)

pgr

Link to comment
Share on other sites

Hope this helps

#include <Array.au3>
Dim $aDrives[1] = [0]

For $x=Asc("A") To Asc("Z")
  MsgBox(0, '', Chr($x), 3)
  If FileExists(Chr($x) & ":\") Then ContinueLoop
  Redim $aDrives[UBound($aDrives)+1]
  $aDrives[0] += 1
  $aDrives[UBound($aDrives)-1] = Chr($x)
Next

_ArrayDisplay($aDrives, "Drives Available")

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
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...