I need to map a network drive from within a .NET application. I’m going to need to use an AD Username and Password to authenticate. Usually I just use a batch file with the net use command. How do I do this from within C# or VB.NET code?
I need to map a network drive from within a .NET application. I’m going
Share
Have you looked at this?
http://www.codeguru.com/csharp/csharp/cs_network/windowsservices/article.php/c12357
Also, you could just use net.exe via
Process.Start()and pass it the parameters you’ve always used in the code below:This can also be used without a drive letter and then accessed through the UNC path.