Accessing Pen drive through VB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • payal25
    New Member
    • Aug 2008
    • 4

    Accessing Pen drive through VB

    Hi all,

    I have a VB 6.0 application which needs to perform the following operations:

    1.Should recognise when the the pen drive is inserted.
    2.Should validate if this is a valid pen drive. i.e if the volume name of the drive is "XXXX" then the user should be allowed to access.
    3.To access a file from the drive.
    4.Make changes into this file and save back to the pen drive.

    I need this urgently but not able to find the required details..
    Kindly help

    Regards
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    kindly post what you have tried so far.

    Comment

    • payal25
      New Member
      • Aug 2008
      • 4

      #3
      Hi

      I am able to get the volume name with the following code.

      Dim fs, d, s
      Set fs = CreateObject("S cripting.FileSy stemObject")
      Set d = fs.GetDrive(fs. GetDriveName(fs .GetAbsolutePat hName("F:")))
      s = "Drive " & d.DriveLetter & ": - " & d.VolumeName
      MsgBox s

      But the problem is
      In GetAbsolutePath Name("F:") i have to specify the drive path.But i want the application to get the path of the removable drive and the use it there.

      What is the code to get the path of the removable drive

      Thanks.

      Comment

      Working...