cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to run cmd from Start Process

Nandita_r
Level 4

Hi,

I am trying to automate to run a schedule from command prompt using Utility-Environment VBO: Start Process The command prompt runs but the argument doesn't run, however I tried using the "Start process Read Stderr" Action but the stage keeps waiting while run and gets hanged.

Nandita_r_0-1717148883263.png

Is there any solution other than automating CMD using attach.

I wanted the Start Process Action to work.

Thanks,

Nandita R
RPA Developer
Qualesce India Pvt Ltd
Bangalore Karnataka
1 BEST ANSWER

Helpful Answers

Hi @Nandita_r ,

You can run the action in the following way as you can see I was able to also start a schedule at my end:

devneetmohanty07_0-1717405878677.png

For setting up the workflow, I have three data items: Username (Text), Password (Password) and Schedule Name (Text). Use the 'Start Process Read Stderr and Stdout' action of the 'Utility - Environment' business object as shown below:

devneetmohanty07_1-1717405971670.png

Process Name: 

"""C:\Program Files\Blue Prism Limited\Blue Prism Automate\AutomateC.exe""" 

Schedule Name:

"/user " & """" & [Username] & """" & " " & """" & [Password] & """" & " /startschedule /schedule " & """" & [Schedule Name] & """"

 

Also, on a side note, even if you have multiple schedules to run, you can write all the scheduler command one after another in one batch script and start the schedule as this will not immediately run the process anyhow but will just set the schedules to run at their designated time frames so it can be used for running multiple schedules for a given day.

 

---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

View answer in original post

6 REPLIES 6

MichealCharron
Level 8

@Nandita_r 

Can you let us know what you have in the [Schedule Argument] data item. Are you using the "/c" CMD.exe option?

 

Micheal Charron
RBC
Toronto, Ontario
Canada

Hi @Nandita_r ,

A bit confused to why you want to open CMD.exe file as this action by default uses System.Diagnostics.Process class which is equivalent to the CMD shell itself. What I mean by this is that you directly can use CMD commands using this action as shown below:

For example, I want to get the hostname for my machine. How I manually would do the same using CMD screen is shown here:

devneetmohanty07_0-1717337526138.png

Now if I want to do the same using Blue Prism, I would use the 'Start Process Read Stderr and Stdout' action of the 'Utility - Environment' business object as shown below:

devneetmohanty07_1-1717337690682.png

You can see that upon executing the workflow, I am getting my desired output in the Standard Output data item:

devneetmohanty07_3-1717337722820.png

Now, potentially if you have multiple commands to be executed one after another you can use this action multiple times in the same way that I showed you but they will work in separate sessions which means that if you have a scenario where let say within the same session you have multiple commands to execute then reusing this action again and again won't work. Also, for any commands using generic system keywords like cd, dir etc., the action cannot be used directly. For these cases, my suggestion would be to create a batch script and run the same using this action.

For example, if I have something like below to be executed:

devneetmohanty07_4-1717337888730.png

For executing these commands, I will create a Batch script file as shown below:

devneetmohanty07_5-1717338378482.png

Now, I can simply run the batch script using the 'Start Process Read Stderr and Stdout' action of the 'Utility - Environment' business object:

devneetmohanty07_6-1717338579244.png

This would be the optimal way to use any CMD based batch script automation workflow in my opinion other than relying on any business object for spying the CMD GUI interface.

---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

Hi @MichealCharron 

I wanted to run this cmd

"C:\Program Files\Blue Prism Limited\Blue Prism Automate\"AutomateC /startschedule /schedule "schedulename" /user "user" "pwd"

Nandita R
RPA Developer
Qualesce India Pvt Ltd
Bangalore Karnataka

Hi @devneetmohanty07 ,

Thanks for the reply but I wanted to run this command: "C:\Program Files\Blue Prism Limited\Blue Prism Automate\"AutomateC /startschedule /schedule "schedulename" /user "user" "pwd"

To start schedules from command prompt, To use batch script I have multiple schedules to run, which cannot be added in one script.

Do use have any other solution where I Can execute this command.

Nandita R
RPA Developer
Qualesce India Pvt Ltd
Bangalore Karnataka

Hi @Nandita_r ,

You can run the action in the following way as you can see I was able to also start a schedule at my end:

devneetmohanty07_0-1717405878677.png

For setting up the workflow, I have three data items: Username (Text), Password (Password) and Schedule Name (Text). Use the 'Start Process Read Stderr and Stdout' action of the 'Utility - Environment' business object as shown below:

devneetmohanty07_1-1717405971670.png

Process Name: 

"""C:\Program Files\Blue Prism Limited\Blue Prism Automate\AutomateC.exe""" 

Schedule Name:

"/user " & """" & [Username] & """" & " " & """" & [Password] & """" & " /startschedule /schedule " & """" & [Schedule Name] & """"

 

Also, on a side note, even if you have multiple schedules to run, you can write all the scheduler command one after another in one batch script and start the schedule as this will not immediately run the process anyhow but will just set the schedules to run at their designated time frames so it can be used for running multiple schedules for a given day.

 

---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

Thank you so much  @devneetmohanty07 

It worked.

Nandita R
RPA Developer
Qualesce India Pvt Ltd
Bangalore Karnataka