Launch .Bat file from Blue Prism

lejack02

New Member
Hi all,

I need to open and execute an existing .Bat file from my process. Basically, the .Bat file create folders that contains 50 files in each from a folder where I have thousands of file. A manipulation I need to do quite often so this .Bat file is crucial !

In Blue Prism, I went i started an action using the VBO Utility - Environment and then the action Start process. I entered the file path in "Application". It launches the cmd but only asks me to "press any key to continue" but it doesn't execute what my .Bat file is supposed to do. Did I do something wrong?

Thank you very much for your help.
 

lejack02

New Member
Hi Tolani,

Thank you for your answer. It still doesn't work for me, I did:

Application: "cmd.exe"
Arguments : "C:/myfile.bat"

It opens the cmd and it is written: "C:\Program Files\Blue Prism Limited\Blue Prism Automate" but didn't execute my .bat file, did I do something wrong?
 

Tolani

New Member
Sure.

Please find attached. I tried also to put the "\" the other way around "/" but didn't change anything. View attachment 119

it is actually / not \. One quick reminder is to ensure you've access to the location the bat file is as this seems to be outside your own user account folder. Secondly, you need to do a cd ../.. as part of your .bat file code into a directory you are likely to have access to. I have attached a sample of my code.

I hope this helps.
 

Attachments

  • Start Process 2.PNG
    Start Process 2.PNG
    19 KB · Views: 736
  • batch script - cmd.PNG
    batch script - cmd.PNG
    9.2 KB · Views: 712
  • batch script - 5.PNG
    batch script - 5.PNG
    19.6 KB · Views: 667

lejack02

New Member
Hi Tolani,
Thank you for this. I just obtained errors on errors, since I don't know this very well (the bat files) I think I do something wrong. Here is the content of my .bat file:

EDIT 5th feb : Hi Tolani, I just entered the filepath in the "Application" and modified slightly my .BAT file, giving the target folder. It works now :)
 
Last edited:

runner67

New Member
Hello Tolani,
Just curious, is the CLI output "Hello World" string available in the Start Process Output tab so that it can be placed into a data item or such?
 

KaliRaj1982

Member
Hi All,

I tried the same as you mentioned in the above. Still I facing the below error,

Utility Environment VBO - Start Process Action

Application: "cmd.exe"
Arguments : "/c c:/Program FIles (x86)\Foldername\AppName.bat"
Error : Internal : Collection name must have [ and ] around it


Thanks
Kali Raj P
 

VJR

Well-Known Member
Hi KaliRaj1982,

The bat file will not open literally but will execute the commands written in the .bat file.
For eg; in the above RenameBatch.bat I have posted, it renames a file in a folder. A dos prompt window will open for a second and go away because the /c switch is used in the arguments.
So to conclude it will depend on what is written in the .bat file.
 

VJR

Well-Known Member
In my case using .bat file opens the application..Please guide me
Right click on the .bat file and Edit it in Notepad and check what is mentioned.
Try changing the path of the .bat file to something simple like C:\test\Filename.bat and run via Blue Prism from that path.
If the issue exists also try removing the /C switch and then run. Maybe there is an error and you are not able to see because the command prompt screens disappears.
 

Tolani

New Member
Hi @KaliRaj1982

If the purpose of your .bat is to open an application, I see no reason why you can't call the Start Process directly with the name of your application & the command line arguments. Please let me know if there are other actions that need to be performed by your batch script aside from launching the application.
 

KaliRaj1982

Member
Actually, in my client network they are using to open the application using .Bat file only. I am not sure why they are using like that. No direct option for launch application. While checking with .Bat file its triggering .R2W application. I was trying with Mainframe application Option.
 

balbir

New Member
Actually, in my client network they are using to open the application using .Bat file only. I am not sure why they are using like that. No direct option for launch application. While checking with .Bat file its triggering .R2W application. I was trying with Mainframe application Option.
I am having similar issue as above. Please advise.
 

peeyush212004

New Member
it is actually / not \. One quick reminder is to ensure you've access to the location the bat file is as this seems to be outside your own user account folder. Secondly, you need to do a cd ../.. as part of your .bat file code into a directory you are likely to have access to. I have attached a sample of my code.

I hope this helps.
Hello Tolani,
I am facing same issue.. Despite of doing all the explained things, BP is only launching the cmd, with text as "C:\Program Files\Blue Prism Limited\Blue Prism Automate". It is not executing the cd operation and other things.. Your help will be highly appreciable here. Here are few snapshots for your reference. When I am executing cmd.exe /K "C:\ex.bat", it is executing properly..
 

Attachments

  • ActionProperty.jpg
    61.8 KB · Views: 223
  • batch file.jpg
    7.3 KB · Views: 206
  • cmd_screenshot.jpg
    16.4 KB · Views: 198
  • Executing through Run.jpg
    7.8 KB · Views: 210
Top