Jump to content
Sign in to follow this  

[udf] _drivemapenum

Recommended Posts


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 

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 & "*"
   If StringRight($sMapList, 1) = "*" Then
      $sMapList = StringLeft($sMapList, StringLen($sMapList)-1)
      Return StringSplit($sMapList, "*")
      $aNULL[0] = 0
      Return $aNULL

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.