Results 1 to 3 of 3

Thread: Drive letter problem

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2004
    Posts
    39

    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.

  2. #2
    Frenzied Member pnish's Avatar
    Join Date
    Aug 2002
    Location
    Tassie, Oz
    Posts
    1,918

    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:
    1. Dim DriveSpec As String
    2. DriveSpec = Left$(frmScan.Drive.List(i), 2) & "\"
    3. mScanFiles.FindFile "*.*", DriveSpec
    Pete

    No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2004
    Posts
    39

    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
  •  



Click Here to Expand Forum to Full Width