<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Running Process from command prompt and capturing output and error in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Running-Process-from-command-prompt-and-capturing-output-and/m-p/56678#M10819</link>
    <description>Hi Team,

In my current project client want to run the processes from command prompt and capture the output whether the process is initiated successfully or not. PFB the code for doing the same.

&amp;nbsp;System.Diagnostics.ProcessStartInfo startInfo =
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new System.Diagnostics.ProcessStartInfo("CMD.exe");

System.Diagnostics.Process p = new System.Diagnostics.Process();

startInfo.RedirectStandardInput = true;

startInfo.UseShellExecute = false;

startInfo.RedirectStandardOutput = true;

startInfo.RedirectStandardError = true;

p = System.Diagnostics.Process.Start(startInfo);

//p.StandardInput.WriteLine(@"Echo on");

//p.StandardInput.WriteLine(@"dir " + @"C:");

p.StandardInput.WriteLine(@"chdir " + @"C:\Program Files\Blue Prism Limited\Blue Prism Automate ");

p.StandardInput.WriteLine(@"AutomateC /run ""Sample process"" /resource /sso");

p.StandardInput.WriteLine(@"EXIT");

&amp;nbsp;result = p.StandardOutput.ReadToEnd();

&amp;nbsp;error = p.StandardError.ReadToEnd();


&amp;nbsp;</description>
    <pubDate>Fri, 22 Jun 2018 16:36:00 GMT</pubDate>
    <dc:creator>AnushaSomasund2</dc:creator>
    <dc:date>2018-06-22T16:36:00Z</dc:date>
    <item>
      <title>Running Process from command prompt and capturing output and error</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Running-Process-from-command-prompt-and-capturing-output-and/m-p/56678#M10819</link>
      <description>Hi Team,

In my current project client want to run the processes from command prompt and capture the output whether the process is initiated successfully or not. PFB the code for doing the same.

&amp;nbsp;System.Diagnostics.ProcessStartInfo startInfo =
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new System.Diagnostics.ProcessStartInfo("CMD.exe");

System.Diagnostics.Process p = new System.Diagnostics.Process();

startInfo.RedirectStandardInput = true;

startInfo.UseShellExecute = false;

startInfo.RedirectStandardOutput = true;

startInfo.RedirectStandardError = true;

p = System.Diagnostics.Process.Start(startInfo);

//p.StandardInput.WriteLine(@"Echo on");

//p.StandardInput.WriteLine(@"dir " + @"C:");

p.StandardInput.WriteLine(@"chdir " + @"C:\Program Files\Blue Prism Limited\Blue Prism Automate ");

p.StandardInput.WriteLine(@"AutomateC /run ""Sample process"" /resource /sso");

p.StandardInput.WriteLine(@"EXIT");

&amp;nbsp;result = p.StandardOutput.ReadToEnd();

&amp;nbsp;error = p.StandardError.ReadToEnd();


&amp;nbsp;</description>
      <pubDate>Fri, 22 Jun 2018 16:36:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Running-Process-from-command-prompt-and-capturing-output-and/m-p/56678#M10819</guid>
      <dc:creator>AnushaSomasund2</dc:creator>
      <dc:date>2018-06-22T16:36:00Z</dc:date>
    </item>
  </channel>
</rss>

