cancel
Showing results for 
Search instead for 
Did you mean: 

Launching a BAT file from BP

maathavanP
Level 3
Hi All    I am trying to automate an application which is launched by a BAT file(Batch file). Is there any possible way to launch a BAT file from BP and  Is it possible to identify objects in an application launched from Batch file. 
2 REPLIES 2

John__Carter
Staff
Staff
Try the Utility Environment object and the Start Process action. Note here 'process' means exe (or bat), not a BP process.

RaúlHernández
Level 5
Hi, maddy1505. Of course it is possible to identify objects in applications launched from Batch file.   What you need to do is the following: * Add a Code action in your object. * In the Code action, you can put a sentence to launch any type of file. For example, with an object configured to use Visual Basic, I put this code to execute a bat file:  system.diagnostics.process.start(""C:\folder\file_name.bat"").  * Lets say that ""file_name.bat"" file executes a java application. You should create a new object, and in the creation wizard you have to configure this object as ""Use an application that is already running"", not from a executable file. * In the same wizard, indicate the window name of the application and the name of process (take it from the Task Manager, in the application process properties). * In your process, use the object to execute the .bat file first, and then use the other object to use the java application.   Tips: Use ""Windows Exist"" to wait for the application after executing the .bat file. You can find this action in the ""Utility - General"" object. For java applications (in this example), you have to use Java Access Bridge to identify the elements.   Good luck.