cancel
Showing results for 
Search instead for 
Did you mean: 

Pass Dynamic Argument to Batch File

KirtishTrivedi
Level 5
Hi Community,

I am Running Batch file from Blueprism using Utility: Environment --> Start Process Action
Application : "cmd.exe"
Argument: "/C C:\Users\....\test.bat"

Batch file Content:
ECHO

cd /d T:\FolderABC
dir /s /b /o:gn >list.csv  

It is running Perfectly Fine

What I need to do is I want to pass folder name Dynamically from BP Process
I can make the content of file like below 

ECHO
cd /d T:\{0}
dir /s /b /o:gn >list.csv

Hence I wanted to know if there is any way to replace {0} with FolderName in batch file from Blueprism

------------------------------
Kirtish Trivedi
------------------------------
1 BEST ANSWER

Best Answers

JerinJose
Level 10
create batch script as "cd /d T:%1" you can run the batch script using utility environment start process and pass the folder name in argument

an example batch script and BP action is shown below

7655.png 

7656.png

------------------------------
Jerin Jose
RPA Product SME
EY
Asia/Kolkata
*"If you find this post helpful mark it as best answer, .*
------------------------------

View answer in original post

4 REPLIES 4

Hi Kirtish,

You create your own BAT file using "Write text file"where you can pass the variable.
Post that you can run it.

------------------------------
Murali
RPA Consultant
------------------------------

Thanks Murali Kodi. This Idea Works

------------------------------
Kirtish Trivedi
------------------------------

JerinJose
Level 10
create batch script as "cd /d T:%1" you can run the batch script using utility environment start process and pass the folder name in argument

an example batch script and BP action is shown below

7655.png 

7656.png

------------------------------
Jerin Jose
RPA Product SME
EY
Asia/Kolkata
*"If you find this post helpful mark it as best answer, .*
------------------------------

Cool, I believe this is the best option

------------------------------
Emerson Ferreira
Sr Business Analyst
Avanade Brasil
Recife
+5581988869544
If my answer helped you? Mark as useful!
------------------------------
Sr Cons at Avanade Brazil