Results 1 to 4 of 4

Thread: Check to see if Mapped UNIX drives are connected

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2008
    Posts
    4

    Check to see if Mapped UNIX drives are connected

    I am fairly new to VB but have constructed a code within Excel to write files from a Windows emulator to a mapped UNIX drive.

    I was just wondering if there is a command to check if the drive has been connected or not. This would then allow me to add a mapping part to my code if the drive had not been connected or at least a warning to the user to connect the drive.

    Any help would be really useful, I have searched around the net and not found a thing that can help.

    Paul

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Check to see if Mapped UNIX drives are connected

    you can use the APIs getlogicaldrivestrings and getdrivetype, to return all the drives available and the type of each drive
    also WNetGetConnection will return the unc path of the logical drive
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2008
    Posts
    4

    Resolved Re: Check to see if Mapped UNIX drives are connected

    Thanks, sorry for the late response but worked great!

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Check to see if Mapped UNIX drives are connected

    Welcome to the forums.

    If you consider this resolved, you could help us out by pulling down the Thread Tools menu and clicking the Mark Thread Resolved menu item. That will let everyone know that you have your answer.

    Thank you.

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