by Karthikeyan (187 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Thu 1st November 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
To check whether particular drive is present or not using GetLogicalDrives API
API Declarations
Const A = 1, B = 2, C = 4, D = 8, E = 16, F = 32, G = 64, H = 128
Const I = 256, J = 512, K = 1024, L = 2048, M = 4096, N = 8192
Const O = 16384, P = 32768, Q = 65536, R = 131072, S = 262144
Const T = 524288, U = 1048576, V = 2097152, W = 4194304
Const X = 8388608, Y = 16777216, Z = 33554432
Dim rval As Long
Dim buff As String
rval = GetLogicalDrives
buff = "Drives in your system are "
If (rval And A) = A Then buff = buff & " A,"
If (rval And C) = C Then buff = buff & " C,"
If (rval And D) = D Then buff = buff & " D,"
If (rval And E) = E Then buff = buff & " E,"
If (rval And F) = F Then buff = buff & " F,"
If (rval And G) = G Then buff = buff & " G,"
If (rval And H) = H Then buff = buff & " H,"
If (rval And I) = I Then buff = buff & " I,"
If (rval And J) = J Then buff = buff & " J,"
If (rval And K) = K Then buff = buff & " K,"
If (rval And L) = L Then buff = buff & " L,"
If (rval And M) = M Then buff = buff & " M,"
If (rval And N) = N Then buff = buff & " N,"
If (rval And O) = O Then buff = buff & " O,"
If (rval And P) = P Then buff = buff & " P,"
If (rval And Q) = Q Then buff = buff & " Q,"
If (rval And R) = R Then buff = buff & " R,"
If (rval And S) = S Then buff = buff & " S,"
If (rval And T) = T Then buff = buff & " T,"
If (rval And U) = U Then buff = buff & " U,"
If (rval And V) = V Then buff = buff & " V,"
If (rval And W) = W Then buff = buff & " W,"
If (rval And X) = X Then buff = buff & " X,"
If (rval And Y) = Y Then buff = buff & " Y,"
If (rval And Z) = Z Then buff = buff & " Z,"
MsgBox Left(buff, Len(buff) - 1)
End
End Sub
No comments have been posted about To check whether particular drive is present or not using GetLogicalDrives API. Why not be the first to post a comment about To check whether particular drive is present or not using GetLogicalDrives API.