Modify Execute2

This commit is contained in:
Virtuworks 2014-06-08 18:29:01 -04:00
parent 6ac1508fcb
commit d4d3548f63
2 changed files with 9 additions and 5 deletions

View file

@ -110,11 +110,9 @@ namespace WebsitePanel.Providers.HostedSolution
//run handheldcleanup.exe //run handheldcleanup.exe
if (File.Exists(file2)) if (File.Exists(file2))
{ {
string serverfilename = "servername.txt";
string arguments2 = string.Format("-u -p {0} < {1}", string arguments2 = string.Format("-u -p {0}",
MAPIProfile, MAPIProfile);
serverfilename);
try try
{ {
string output; string output;

View file

@ -193,12 +193,18 @@ namespace WebsitePanel.Providers.HostedSolution
startInfo.RedirectStandardError = true; startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true; startInfo.RedirectStandardOutput = true;
startInfo.UseShellExecute = true; startInfo.RedirectStandardInput = true;
startInfo.UseShellExecute = false;
startInfo.CreateNoWindow = true; startInfo.CreateNoWindow = true;
startInfo.WindowStyle = ProcessWindowStyle.Hidden; startInfo.WindowStyle = ProcessWindowStyle.Hidden;
Process proc = Process.Start(startInfo); Process proc = Process.Start(startInfo);
StreamWriter inputWriter = proc.StandardInput;
inputWriter.Write(EnterpriseServer);
inputWriter.Flush();
inputWriter.Close();
if (proc == null) if (proc == null)
throw new ApplicationException("Proc is null."); throw new ApplicationException("Proc is null.");