Sign in to follow this  
Followers 0
SumTingWong

[udf] _drivemapenum

1 post in this topic

In the absence of a built-in DriveMapEnum, here's a little something to fill the gap

Dim $s, $i

; Usage example
$s = _DriveMapEnum()
MsgBox(4096,'debug:' , '$s:' & $s[0]);### Debug MSGBOX 
For $i = 1 To $s[0] Step 2
   MsgBox(4096,'debug:' , $s[$i] & " - " & $s[$i+1]);### Debug MSGBOX 
Next

Func _DriveMapEnum()
   Local $aNULL[1]
   Local $i   
   Local $sMap
   Local $sMapList = ""
   
   For $i = 68 To 90
      $sMap = DriveMapGet(Chr($i) & ":")
      If $sMap <> "" Then $sMapList = $sMapList & Chr($i) & ":*" & $sMap & "*"
   Next
   If StringRight($sMapList, 1) = "*" Then
      $sMapList = StringLeft($sMapList, StringLen($sMapList)-1)
      Return StringSplit($sMapList, "*")
   Else
      $aNULL[0] = 0
      Return $aNULL
   EndIf
EndFunc

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