Question

I'm fairly new to WebDAV , how do I go about coding in vb or C# to automap a network drive and check if letter G:\ is available and if it is , assign that letter, if not go to H , I, J ,K drives ?

thank you in advance

Was it helpful?

Solution

You can start a process to add the network drive. Then you can check to see when and how p finishes.

Dim p As Process
p = System.Diagnostics.Process.Start("net.exe", "use r: \\reo\c-drive")

Here is one way to check the availability of a drive letter:

If System.IO.Directory.Exists("c:\") Then ...

You can also use Windows API calls, which are messier to write but don't require a separate process.

It's usually not necessary to map a network drive, however, because you can generally use the network path instead of the mapped drive letter.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top