Click here to Skip to main content
15,121,414 members
Home / Discussions / C#


AnswerRe: how can i show google earth in winform c# Pin
Richard MacCutchan27-May-16 3:58
mveRichard MacCutchan27-May-16 3:58 
GeneralRe: anyway thank sir!i get setparent but need placemark,polygon,etc.. i m just beginner. :-O Pin
Member 1252559627-May-16 4:55
MemberMember 1252559627-May-16 4:55 
GeneralRe: how can i show google earth in winform c# Pin
Pete O'Hanlon27-May-16 5:17
mvePete O'Hanlon27-May-16 5:17 
QuestionWhat Does Complexity of Algorithm Mean??? Pin
Django_Untaken26-May-16 1:14
MemberDjango_Untaken26-May-16 1:14 
AnswerRe: What Does Complexity of Algorithm Mean??? Pin
Richard MacCutchan26-May-16 1:18
mveRichard MacCutchan26-May-16 1:18 
Pete O'Hanlon26-May-16 1:20
mvePete O'Hanlon26-May-16 1:20 
GeneralRe: What Does Complexity of Algorithm Mean??? Pin
harold aptroot26-May-16 1:52
Memberharold aptroot26-May-16 1:52 
QuestionHow to read process Output Message from process within the process ?? Pin
ArunRagam26-May-16 0:45
professionalArunRagam26-May-16 0:45 
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 of PatchInstaller.exe.
Is there any way of getting output of process running within process?
Following is the code i have tired...

string command = @"C:\Users\sysadmin\Desktop\Setup\PatchInstaller.exe";
string result = string.Empty;
Exitcode = 0;

                Exitcode = 0;
                // create the ProcessStartInfo using "cmd" as the program to be run, and "/c " as the parameters.
                // Incidentally, /c tells cmd that we want it to execute the command that follows, and then exit.
                System.Diagnostics.ProcessStartInfo procStartInfo = new ProcessStartInfo();
procStartInfo = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + command + " --mode=silent);
                System.Diagnostics.Process proc = new Process();
// The following commands are needed to redirect the standard output. 
//This means that it will be redirected to the Process.StandardOutput StreamReader.
procStartInfo.ErrorDialog = false;
                procStartInfo.UseShellExecute = false;
                procStartInfo.RedirectStandardOutput = true;
                procStartInfo.RedirectStandardError = true;

                procStartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                // Do not create the black window.
                procStartInfo.CreateNoWindow = true;

                if (!string.IsNullOrEmpty(domain) && !string.IsNullOrEmpty(user) && !string.IsNullOrEmpty(pwd))
                    procStartInfo.Domain = domain;
                    procStartInfo.UserName = user;

                    System.Security.SecureString ss = new System.Security.SecureString();
                    foreach (char c in pwd) { ss.AppendChar(c); }
                    procStartInfo.Password = ss;

                // Now we create a process, assign its ProcessStartInfo and start it
                proc = System.Diagnostics.Process.Start(procStartInfo);
                proc.ErrorDataReceived += delegate(object sender, System.Diagnostics.DataReceivedEventArgs errorLine)
                    if (errorLine.Data != null) result += "error:" + errorLine.Data + "\r\n";

                proc.OutputDataReceived += delegate(object sender, System.Diagnostics.DataReceivedEventArgs outputLine)
                    if (outputLine.Data != null) result += outputLine.Data + "\r\n";

                Process[] pname = Process.GetProcessesByName("AdobePatchInstaller");
Process[] processlist = Process.GetProcesses();
                foreach (Process theprocess in processlist)
                    Console.WriteLine("Process: {0} ID: {1}", theprocess.ProcessName, theprocess.Id);


            catch (Exception ex)
                throw (ex);

            return result;

modified 26-May-16 6:06am.

QuestionAdvice needed Pin
osxman25-May-16 11:14
Memberosxman25-May-16 11:14 
GeneralRe: Advice needed Pin
CHill6025-May-16 11:56
mveCHill6025-May-16 11:56 
GeneralRe: Advice needed Pin
OriginalGriff25-May-16 20:38
mveOriginalGriff25-May-16 20:38 
GeneralRe: Advice needed Pin
osxman25-May-16 22:50
Memberosxman25-May-16 22:50 
GeneralRe: Advice needed Pin
Pete O'Hanlon25-May-16 22:56
mvePete O'Hanlon25-May-16 22:56 
GeneralRe: Advice needed Pin
OriginalGriff25-May-16 23:04
mveOriginalGriff25-May-16 23:04 
GeneralRe: Advice needed Pin
osxman25-May-16 23:12
Memberosxman25-May-16 23:12 
GeneralRe: Advice needed Pin
OriginalGriff25-May-16 23:17
mveOriginalGriff25-May-16 23:17 
GeneralRe: Advice needed Pin
osxman25-May-16 23:31
Memberosxman25-May-16 23:31 
GeneralRe: Advice needed Pin
Richard Deeming26-May-16 2:58
mveRichard Deeming26-May-16 2:58 
GeneralRe: Advice needed Pin
rickrose050626-May-16 4:11
Memberrickrose050626-May-16 4:11 
GeneralRe: Advice needed Pin
Mycroft Holmes26-May-16 15:36
professionalMycroft Holmes26-May-16 15:36 
AnswerRe: Advice needed Pin
Garth J Lancaster26-May-16 1:10
mveGarth J Lancaster26-May-16 1:10 
AnswerRe: Advice needed Pin
F-ES Sitecore26-May-16 1:16
mveF-ES Sitecore26-May-16 1:16 
AnswerRe: Advice needed Pin
Gerry Schmitz26-May-16 8:13
mveGerry Schmitz26-May-16 8:13 
QuestionConvert Pin
Bakeel25-May-16 10:36
MemberBakeel25-May-16 10:36 
QuestionRe: Convert Pin
CHill6025-May-16 11:53
mveCHill6025-May-16 11:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.