[RESOLVED] Runing rar.exe windows server 2008
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: [RESOLVED] Runing rar.exe windows server 2008

  1. #1
    Join Date
    Oct 2008
    Posts
    30

    [RESOLVED] Runing rar.exe windows server 2008

    I wrote a little tool to rar files:

    Code:
    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.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,197

    Re: Runing rar.exe windows server 2008

    Take a look at the ProcessStartInfo properties. You'll find one that allows you to hide the main window.

  3. #3
    Join Date
    Oct 2008
    Posts
    30

    Re: Runing rar.exe windows server 2008

    Well.... it can do the trick but i can´t capture standadrd ouput.

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,197

    Re: Runing rar.exe windows server 2008

    Quote Originally Posted by Zeokat View Post
    Well.... it can do the trick but i canīt capture standadrd ouput.
    That's a different question. You'll need to add handlers to capture std error and std out.

  5. #5
    Join Date
    Mar 2011
    Posts
    1

    Smile Re: [RESOLVED] Runing rar.exe windows server 2008

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center