String command = "installutil/i"; string wanted_actual = "D:\\pstools\\"; string wanted = wanted_actual + "PsExec"; String folderpath2 = D:\Winservice\Service.exe String 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; //To hide window procStartInfo.CreateNoWindow = true; //To hide window procStartInfo.WindowStyle = ProcessWindowStyle.Hidden; //To hide window proc.Start(); richTextBox1.Text = proc.StandardOutput.ReadToEnd();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)