ProcessStartInfo procStartInfo = new ProcessStartInfo(rar, "command");
procStartInfo.RedirectStandardOutput = true;
procStartInfo.RedirectStandardError = true;
procStartInfo.UseShellExecute = false;
// Do not create the black window.
procStartInfo.CreateNoWindow = true;
// Now we create a process, assign its ProcessStartInfo and start it
Process proc = new Process();
proc.StartInfo = procStartInfo;
proc.Start();
while (proc.HasExited == false)
{
proc.WaitForExit();
}
textBox1.AppendText("Done");
It works good if i run into windows XP SP3, but when i try to run it into windows server 2008 (no admin rights) it starts compressing but hangs while compressing (no return any error), if i close the the tool suddenly the rar.exe process works and continue compressing.
At the same time if i run with "procStartInfo.UseShellExecute = true;" it works good and compress good (but i not want the black screen showed).
Any idea about why this happens?
Thanks in advance for your help.
Last edited by Zeokat; October 19th, 2010 at 10:58 AM.
Hi Guys,
I am facing the same problem. In C++ with system command I am compressing text file using rar.exe. Its working fine on Windows Xp. But when the same program runs on Windows server 2003 machine, Sometimes the processing gets stuck. In task manager if I terminate rar.exe, the process continues in normal ways. This issue is not occuring frequently, case would once in thousand requests.
Can you please help me with the same.
Thanks in advance.
Bookmarks