proc.StandardOutput.ReadToEnd(); i am able to capture only first 2 lines of log from server
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
But the same command i execute from cmd able to view the entire winservice installed log in cmd prompt. but while install using C# unable to view the log in richTextBox1.Text
Please help me ...
String command = "installutil/i";
string wanted_actual = "D:\\pstools\\";
string wanted = wanted_actual + "PsExec";
String folderpath2 = D:\Winservice\Service.exeString total = (command + " " + folderpath2);
System.Diagnostics.Process proc = new System.Diagnostics.Process();ProcessStartInfo procStartInfo = new ProcessStartInfo();procStartInfo.FileName = wanted; procStartInfo.WorkingDirectory = Path.GetDirectoryName(wanted_actual);procStartInfo.Arguments = @"\\" + txt_Serverip.Text + " -u " + txt_Username.Text + " -p " + txtPassword.Text + " -accepteula" + " -s" + " -w " + "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319" + " cmd " + "/c " + total;
proc.StartInfo = procStartInfo;proc.StartInfo.RedirectStandardOutput = true; procStartInfo.UseShellExecute = false;procStartInfo.CreateNoWindow = true; procStartInfo.WindowStyle = ProcessWindowStyle.Hidden;proc.Start(); richTextBox1.Text = proc.StandardOutput.ReadToEnd();
Kirankumar PPosted Mar 4, 2016, 8:41 PM
proc.StandardOutput.ReadToEnd();i tried the above two i am not getting any error . the service is installing in server and unable to capture entire success or install failed log ..Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
Rajeev PunhaniPosted Mar 2, 2016, 12:16 PM
If the above solution is helpful then,accept the answer.