Enumerating Local And Network Drives

October 8, 2004 – 2:32 pm

Is there a way that I can return all available local drive letters ? Yes, there is a way !

1
Declare Function GetLogicalDriveStrings Lib "kernel32" Alias "GetLogicalDriveStringsA" (Byval nBufferLength As Long, Byval lpBuffer As String) As Long
1
2
3
4
5
6
7
8
9
10
11
12
13
Function GetDrives() As String
  Dim tmp As String
  Dim iCount As Integer
  Dim strDrives As String
 
  strDrives = Space$(64)
  Call GetLogicalDriveStrings(Len(strDrives), strDrives)
       For iCount = 1 To Len(strDrives) Step 4
           tmp = tmp & " " + Mid$(strDrives, iCount, 1)
      Next iCount
 
     GetDrives = Trim(tmp)
End Function
1
2
3
Sub Click(Source As Button)
    Msgbox getdrives
End Sub

Related posts:

  1. SnTT: Is database design hidden (Notes API Solution)
  2. Play MP3 without WINAMP using Lotus Script
  3. @Command([ToolsUserLogoff]) in Lotus Script
  4. Determine Drive Types and Next Available Drive Letter
  5. PING in LotusScript

Sorry, comments for this entry are closed at this time.