From d4d3548f633e09ac8c6514a47f5c2b58cda42aa7 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Sun, 8 Jun 2014 18:29:01 -0400 Subject: [PATCH] Modify Execute2 --- .../BlackBerry5Provider.cs | 6 ++---- .../BlackBerryProvider.cs | 8 +++++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/BlackBerry5Provider.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/BlackBerry5Provider.cs index 4e0b947f..cdd47dad 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/BlackBerry5Provider.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/BlackBerry5Provider.cs @@ -110,11 +110,9 @@ namespace WebsitePanel.Providers.HostedSolution //run handheldcleanup.exe if (File.Exists(file2)) { - string serverfilename = "servername.txt"; - string arguments2 = string.Format("-u -p {0} < {1}", - MAPIProfile, - serverfilename); + string arguments2 = string.Format("-u -p {0}", + MAPIProfile); try { string output; diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/BlackBerryProvider.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/BlackBerryProvider.cs index e24e62cb..5bf79df6 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/BlackBerryProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/BlackBerryProvider.cs @@ -193,12 +193,18 @@ namespace WebsitePanel.Providers.HostedSolution startInfo.RedirectStandardError = true; startInfo.RedirectStandardOutput = true; - startInfo.UseShellExecute = true; + startInfo.RedirectStandardInput = true; + startInfo.UseShellExecute = false; startInfo.CreateNoWindow = true; startInfo.WindowStyle = ProcessWindowStyle.Hidden; Process proc = Process.Start(startInfo); + StreamWriter inputWriter = proc.StandardInput; + inputWriter.Write(EnterpriseServer); + inputWriter.Flush(); + inputWriter.Close(); + if (proc == null) throw new ApplicationException("Proc is null.");