Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

Run CMD Function In NAV 2016

$
0
0
Need to develop CMD opertation net use to map network drive from NAV 2016.

Trying to use DotNet variable:
  • System.Diagnostics.Process.'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
  • System.Diagnostics.ProcessStartInfo.'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'


MappingCMDString:
net use %1 %2 /user %3 %4 /persistent:yes

The code:
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);

But nothing being processed. Where i did mistake? :neutral:

Viewing all articles
Browse latest Browse all 10032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>