|
-
Jan 7th, 2005, 01:34 AM
#1
Thread Starter
Member
Drive letter problem
I was trying to get this code to scan my two drives but doesn't do it, because it returns the whole drive name 'c:=[My Drive]', instead of the drive letter 'c:'
Dim i As Integer
For i = 0 To frmScan.Drive.ListCount - 1
'Search All the drives
Log "Scanning drive " & UCase(frmScan.Drive.List(i)) & "\"
frmScan.lblOperation.Caption = "Scanning drive " & UCase(frmScan.Drive.List(i)) & "\"
mScanFiles.FindFile "*.*", UCase(frmScan.Drive.List(i)) & "\"
DoEvents
Next i
'Log and show completion
Log "Scan Complete!"
frmScan.lblOperation = "Finished"
frmScan.lblCurFile = "-Scan Complete-"
frmScan.lblGoAbort.Enabled = False
frmScan.lblGoFix.Enabled = True
End If
How can I return just the drive letter.
-
Jan 7th, 2005, 01:53 AM
#2
Re: Drive letter problem
You need to parse the drive letter from frmScan.Drive.List(i). So if frmScan.Drive.List(i) = "C:=[My Drive]", do something like this:
VB Code:
Dim DriveSpec As String
DriveSpec = Left$(frmScan.Drive.List(i), 2) & "\"
mScanFiles.FindFile "*.*", DriveSpec
Pete
No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.
-
Jan 7th, 2005, 07:12 AM
#3
Thread Starter
Member
Re: Drive letter problem
Thank you for you prompt response, It was excatly was I was looking for !!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|