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 ...
Code
String command = "installutil/i";Code
string wanted_actual = "D:\\pstools\\";Code
string wanted = wanted_actual + "PsExec";Code
String folderpath2 = D:\Winservice\Service.exeCode
String total = (command + " " + folderpath2);Code
System.Diagnostics.Process proc = new System.Diagnostics.Process();Code
ProcessStartInfo procStartInfo = new ProcessStartInfo();Code
procStartInfo.FileName = wanted;Code
procStartInfo.WorkingDirectory = Path.GetDirectoryName(wanted_actual);VB.NET
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;Code
proc.StartInfo = procStartInfo;Code
proc.StartInfo.RedirectStandardOutput = true;Code
procStartInfo.UseShellExecute = false;Code
procStartInfo.CreateNoWindow = true;Code
procStartInfo.WindowStyle = ProcessWindowStyle.Hidden;Code
proc.Start();Code
richTextBox1.Text = proc.StandardOutput.ReadToEnd();
Rajeev PunhaniRank #551 · 4.4K reputationPosted Mar 2, 2016, 7:16 AM EST
If the above solution is helpful then,accept the answer.
Kirankumar P3 reputationPosted Mar 4, 2016, 3:41 PM EST
while connectivity to server using local system able to capture only first lines like below