title: using C# Process to run a Executable program
body: <p>I am a Bioinformatic person and I use C# for my work. I have been using Processes in C# to run Executable programs several times. This time I have a new issue. I have downloaded an exe file in Windows for a program named Blast(<a href="http://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&amp;PAGE_TYPE=BlastDocs&amp;DOC_TYPE=Download" rel="nofollow">http://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&amp;PAGE_TYPE=BlastDocs&amp;DOC_TYPE=Download</a>). If I type in my command which is :</p>
  
  <pre><code>blastp -query input.txt -db pdbaa -out output.txt
  </code></pre>
  
  <p>it works fine. But when I copy paste the command from a notepad it will give an error. I searched for the problem and I found that it is an "encoding problem UTF-8 versus ISO-latin" (<a href="http://biostar.stackexchange.com/questions/7997/an-error-by-using-ncbi-blast-2-2-25-on-windows" rel="nofollow">http://biostar.stackexchange.com/questions/7997/an-error-by-using-ncbi-blast-2-2-25-on-windows</a>) which is caused by copy and paste. </p>
  
  <p>Now that I want to run the process from c# to call the exe file I get the same problem and I guess it is because the process does something like copy and paste. Here is my code:</p>
  
  <pre><code> public void Calculate()
      {
          Process proc = new Process();
          proc.StartInfo.WorkingDirectory = Program.NCBIBlastDirectory;
          proc.StartInfo.FileName = @"C:\Program Files\NCBI\blast-2.2.25+\bin\blastp.exe";
          proc.StartInfo.Arguments = "blastp -query input.txt -db pdbaa -out output.txt";
          proc.StartInfo.UseShellExecute = false;
          proc.StartInfo.RedirectStandardError = true;
          proc.StartInfo.RedirectStandardError = true;
          proc.Start();
          proc.WaitForExit();
          proc.Close();
      }
  </code></pre>
  
  <p>Do you have any idea how I can solve this?</p>
  
  <p>Thanks in advance.</p>