net use %1 %2 /user %3 %4 /persistent:yes
SystemDiagnosticsProcessStartInfo := SystemDiagnosticsProcessStartInfo.ProcessStartInfo('cmd','/c"' + STRSUBSTNO(MappingCMDString,DriveLetter,Path,UserName,Password) + '"'); SystemDiagnosticsProcessStartInfo.RedirectStandardError := TRUE; SystemDiagnosticsProcessStartInfo.RedirectStandardOutput := TRUE; SystemDiagnosticsProcessStartInfo.UseShellExecute := FALSE; SystemDiagnosticsProcessStartInfo.CreateNoWindow := TRUE; SystemDiagnosticsProcess := SystemDiagnosticsProcess.Start(SystemDiagnosticsProcessStartInfo); CLEAR(SystemDiagnosticsProcess);
Answers
Check this command via "Win + R" - it works.
So problem is in calling this line from NAV.
I tried your code in the 1st post, but also could not get it to work. You mentioned in your last post, it was due to a wrong syntax. What was wrong with the syntax?
Jordi
I found out what's wrong. for other ppl looking to this, the correct code is -->
Changes are in line 1 of the code. Removed double quotes and added a <space> after /c
Jordi