System.Diagnostics.Process is not giving response - D3565 FO


I am trying to run a batch using System.Diagnostics.Process , but it is not giving any error nor giving the result

I am using PU34

System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo myProcessStartInfo = new System.Diagnostics.ProcessStartInfo("cmd.exe");

myProcessStartInfo.Arguments = '"C:\\Users\\admin144423\\Documents\\batch1.bat"';
myProcessStartInfo.UseShellExecute = false;
myProcessStartInfo.RedirectStandardOutput = true;
myProcessStartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle::Hidden;
myProcessStartInfo.CreateNoWindow = true;
myProcess.StartInfo = myProcessStartInfo;

I tried the batch file from other drives as well giving shared permission, but it doesnot show any error.

On executing this bat file from command prompt, I am getting the result.

Am I missing something?

No Data
  • First of all, the whole idea of accessing a local file looks wrong to me, because you won't be able to put such a file to environments managed by Microsoft. If it can't work in production, do you really spend any time with it? It sounds like you should throw it away and prepare a more meaningful design.

    We should be able to help you if you explain the business requirement to us.