|
-
Jan 30th, 2008, 11:33 AM
#1
Thread Starter
New Member
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
-
Jan 30th, 2008, 03:43 PM
#2
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
-
Feb 14th, 2008, 09:07 AM
#3
Thread Starter
New Member
Re: Check to see if Mapped UNIX drives are connected
Thanks, sorry for the late response but worked great!
-
Feb 14th, 2008, 09:32 AM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|