I am running an exe through commandline and getting following output.
C:\Users\sysadmin>C:\Users\sysadmin\Desktop\New_folder\Setup\PatchInstaller.exe --mode=silent
C:\Users\sysadmin Begin Setup UI mode: Silent Error : Another instance running, Only a single instance can be run at a time. Exit Code: 11
i am running this through System.daignostics.process.
My issue is PatchInstaller.exe calling another process and the output of that nested process is what is visible with cmd. but the same result and exit code i am not able to get through Process object ofPatchInstaller.exe. Is there any way of getting output of process running within process?
Following is the code i have tired...
Here my exe is running and it will execute the below line first,
C:\Users\sysadmin\Desktop\New_folder\Setup\PatchInstaller.exe --mode=silent
Now PatchInstaller.exe is internally executing other process, I am expecting the output from this internal process,
(Example A:
C:\Users\sysadmin\Desktop\New_folder\Setup\PatchInstaller.exe --mode=silent
C:\Windows\system32>Begin SetupUI mode: Silent
Error : Conflicting Processes running.
Exit Code: 19
)
(Note: PatchInstaller.exe is thirdparty exe. When we are excuting from command-line we are getting (Example A) output. )
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Amit GuptaPosted Jun 7, 2016, 1:22 PM
using System;using System.Collections.Generic;using System.Diagnostics;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Test_CmdExec{class Program{{try{{{RedirectStandardInput = true,UseShellExecute = false,catch (Exception ex){{Process p = sender as Process;return;{Process p = sender as Process;return;Amit GuptaPosted Jun 7, 2016, 1:21 PM
using System;using System.Collections.Generic;using System.Diagnostics;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Test_CmdExec{class Program{{try{{{RedirectStandardInput = true,UseShellExecute = false,catch (Exception ex){{Process p = sender as Process;return;{Process p = sender as Process;return;