I'm trying to map a network drive within VB.Net and not sure how close I am to achieving it
I basically want to do this (which can be done from a command prompt)
net use s: \\Volume\Directory
and tried to do it by using this code
This doesn't work, I get an error on the Process Start.
Dim startInfo As System.Diagnostics.ProcessStartInfo
Dim pStart As New System.Diagnostics.Process
startInfo = New System.Diagnostics.ProcessStartInfo("net use s: \\Volume\Directory")
pStart.StartInfo = startInfo
I then found this code on MSDN but it's for C#
I've tried to translate, but not getting anywhere ...
System.Diagnostics.ProcessStartInfo processInfo = new System.Diagnostics.ProcessStartInfo();
processInfo.FileName = @"C:\WINDOWS\system32\net";
processInfo.Arguments = @"use X: \\MYPC\Folder /USER:MYPC\TEST P@ssw0rd";
Can someone please help?