Solved Automate Command Prompt using blue prism

Status
Not open for further replies.

kosmik5

New Member
Hi,
I am trying to create a BOT in RPA that will read excel files and then try to execute some standard commands from the command prompt using the data in excel files. I am using Blue Prism for this purpose. While I am able to read excel files and store the data in the collection, I am not able to automate command prompt in Blue Prism. I tried to use a coding stage in c# to create a cmd process ( code is given below), but it does not recognize the 'Process' class.

System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new
System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "<command script>";
process.StartInfo = startInfo;
process.Start();

Thank You
Hari
 

Tolani

New Member
This thread is a bit old but BP has an action called "Start Process" under Utility - Environment object. You can create a bat file (.bat) with a couple of instructions you want to be executed at the cmd prompt. The Start Process (creates a shell already) has 2 parameters; Application and Arguments. You can pass "cmd.exe" in the Application parameter and Arguments "/c c:/blabla.bat". This will execute the bat file and mind you, BP is automatically attached to the command prompt. I hope this helps.
 
Status
Not open for further replies.
Top