4 January, 2018
0 Comments
1 category
// Create network drive mapping
System.Diagnostics.Process.Start(“net.exe”, @”use K: “”\\my.server.com\Websites\Mail“” /user:MyDomain\admin MySuperSecretPassword”).WaitForExit();
// Remove network drive mapping
System.Diagnostics.Process.Start(“net.exe”, @”use K: /delete”).WaitForExit();
Tags: C#
Category: Uncategorized
Nice. I had old code that was using the Windows Script Host interop to map drives that was acting buggy after users switched from Windows 7 to 10. I tried your approach with much better success. Thanks