I\'m writing a piece of software which maps a network drive using the WNetAddConnection2 API. Just in case it\'s relevant, this is a WebDAV drive, rather than a normal SMB shar
You could use PowerShell in your C# code, the https://msdn.microsoft.com/en-us/library/system.management.automation.powershell(v=vs.85).aspx
Change DriveLetter E
to Q
with PowerShell
$drive = Get-WmiObject -Class win32_volume -Filter "DriveLetter = 'e:'"
Set-WmiInstance -input $drive -Arguments @{DriveLetter="Q:"; Label="Label"}