Sign in to follow this  
Followers 0
pgr

Find Free Drive Letters

4 posts in this topic

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

Share this post


Link to post
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())

Share this post


Link to post
Share on other sites

Thanks for the fast response, I think this helps... will try to integrate them into my Script :-)

Share this post


Link to post
Share on other sites

Works! :-)

I pass the Data into my ComboBox with GUICtrlSetData(-1,$DrivesAvail[$n] & ":" & "|") and get the listing i wanted to have... thanks a lot for your help guys!

pgr

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